Any consistent regularization scheme induces an apparent violation of gauge invariance in non-anomalous chiral gauge theories. This violation shows up in perturbative calculations, and can be removed by including appropriate finite counterterms. In this talk I will discuss the derivation of such counterterms for a renormalizable chiral gauge theory. I will use the background field method, which ensures background gauge invariance in the quantized theory. As a concrete application, I will show the finite counterterm at one loop in the Standard Model, within dimensional regularization and the Breitenlohner-Maison-'t Hooft-Veltman prescription for gamma5.