We present an efficient real-space multigrid method for first-principles electronic structure calculations, based on the pseudopotential method within the local-density-functional approximation. The Poisson and Kohn-Sham equations are accurately discretized by a higher-order finite difference method, and solved efficiently by a multigrid technique, which uses different relaxations for different sets of real-space grids. Testing various systems, we find the convergence to be nearly independent of the number of real-space grids. We demonstrate that our method is very useful for charged clusters and defects in localized bulk systems. (C) 1999 Elsevier Science B.V. All rights reserved.