The local BRST cohomology of the gauged non-linear sigma model on a group manifold is worked out for any Lie group G. We consider both, the case where the gauge field is dynamical and the case where it has no kinetic term (G/G topological theory). Our results shed a novel light on the problem of gauging the WZW term as well as on the nature of the topological terms introduced a few years ago by De Wit, Hull and Roček. We also consider the BRST cohomology of the rigid symmetries of the ungauged model and recover the results of D'Hoker and Weinberg on the most general effective actions compatible with the symmetries.