Let (M, g) be a noncompact complete n-manifold with harmonic curvature and positive Sobolev constant. Assume that the L2 norms of the traceless Ricci curvature are finite. We prove that (M, g) is Einstein if n ≥ 5 and the Ln/2 norms of the Weyl curvature and traceless Ricci curvature are small enough.