A layered -matrix based inverse algorithm and a layered -matrix based LU factorization and solution algorithm are developed to accelerate the direct solution of the finite element matrix resulting from electromagnetics-based analysis of general 3-D problems. In these algorithms, the direct solution of the original 3-D system matrix is transformed to the direct solution of multiple 2-D problems. The size of the matrix to be computed is thus reduced from a 3-D size to a 2-D size. Moreover, the growth rate of the rank of the inverse finite element matrix with electric size is reduced from a 3-D based growth rate to a 2-D based growth rate. Numerical experiments have demonstrated the clear advantages of the proposed direct solvers over a state-of-the-art multifrontal based direct sparse solver as well as existing fast -matrix based direct solvers, in both CPU time and memory consumption, for finite-element analysis of general 3-D electromagnetic problems.Index Terms--matrix, direct matrix solution, finite element methods, electromagnetic analysis.