  Let $G$ be a connected graph. If $G$ contains a matching of size $k$, and
every matching of size $k$ is contained in a perfect matching of $G$, then $G$
is said to be \emph{$k$-extendable}. A $k$-regular spanning subgraph of $G$ is
called a \textit{$k$-factor}. In this paper, we provide spectral conditions for
a (balanced bipartite) graph with minimum degree $\delta$ to be $k$-extendable,
and for the existence of a $k$-factor in a balanced bipartite graph,
respectively. Our results generalize some previous results on perfect matchings
of graphs, and extend the results in \cite{D.F} and \cite{W.L} to
$k$-extendable graphs. Furthermore, our results generalize the result of Lu,
Liu and Tian \cite{Lu-Liu} to general regular factors. Additionally, using the
equivalence of $k$ edge-disjoint perfect matchings and $k$-factors in balanced
bipartite graphs, our results can derive a spectral condition for the existence
of $k$ edge-disjoint perfect matchings in balanced bipartite graphs.
