We prove that for any $tge 3$ there exist constants $c>0$ and $n_0$ such that any $d$-regular $n$-vertex graph $G$ with $tmid ngeq n_0$ and second largest eigenvalue in absolute value $lambda$ satisfying $lambdale c d^{t}/n^{t-1}$ contains a $K_t$-factor, that is, vertex-disjoint copies of $K_t$ covering every vertex of $G$.