The divergences of the gravitational action are analyzed for space-times that are asymptotically anti-de Sitter and asymptotically flat. The gravitational action is rendered finite using a local counterterm prescription, and the relation of this method to the traditional reference space-time is discussed. For AdS, an iterative procedure is devised that determines the counterterms efficiently. For asymptotically flat space, we use a different method to derive counterterms which are sufficient to remove divergences in most cases. (C) 1999 Elsevier Science B.V. All rights reserved.