  Using the background-field method we demonstrate the
Becchi-Rouet-Stora-Tyutin (BRST) structure of counterterms in a broad class of
gauge theories. Put simply, we show that gauge invariance is preserved by
renormalization in local gauge field theories whenever they admit a sensible
background-field formulation and anomaly-free path integral measure. This class
encompasses Yang-Mills theories (with possibly Abelian subgroups) and
relativistic gravity, including both renormalizable and non-renormalizable
(effective) theories. Our results also hold for non-relativistic models such as
Yang-Mills theories with anisotropic scaling or Horava gravity. They strengthen
and generalize the existing results in the literature concerning the
renormalization of gauge systems. Locality of the BRST construction is
emphasized throughout the derivation. We illustrate our general approach with
several explicit examples.
