We study classes of universal algebras in a variety that are closed under the formation of Cartesian products, homomorphic images and extensions. We prove a Birkhoff type theorem for such axiomatic classes. Let V be a variety of algebras of a fixed type τ and let S be a set of first order sentences in the language of τ of the form (∃x1) . . . (∃xn)((u1 = v1) ∧ · · · ∧ (um = vm)), where u1, v1, ...