We construct a new equivariant cohomology theory for a certain class of differential vertex algebras, which we call the chiral equivariant cohomology. A principal example of a differential vertex algebra in this class is the chiral de Rham complex of Malikov-Schechtman-Vaintrob of a manifold with a group action. The main idea in this paper is to synthesize the algebraic approach to classical equivariant cohomology due to H. Cartan, with the theory of differential vertex algebras, by using an appropriate notion of invariant theory. We also construct the vertex algebra analogues of the Mathai-Quillen isomorphism, the Weil and the Cartan models for equivariant cohomology, and the Chern-Weil map. We give interesting cohomology classes in the new theory that have no classical analogues.