A description of a new Fourier technique is given for calculating the gravitational attraction of a layer with an irregular top surface for application in the terrain correction of marine gravity surveys in shallow water. An earlier Fourier-based algorithm fails or becomes inaccurate when the peaks of the topography approach the sea surface too closely. The new approach divides the attraction into two parts: a local contribution from the material within a cylinder around each observation point and the attraction from the matter outside the cylinder. A special quadrature rule, optimized for the actual data distribution, evaluates the local contribution. The calculation of the exterior component represents the bulk of the numerical effort. Fortunately, the exterior integral possesses an expansion as a series of convolutions, and by evaluating these in the Fourier domain, the procedure can take advantage of the efficiency of the fast Fourier transform. Chebychev economization of the convolution series provides further significant improvements in computational speed.Two examples, one artificial and the other based on a survey around Guadalupe Island, illustrate the application of the new technique. Estimates of the errors from computation sources and from the inadequacies of the topographic model confirm the general accuracy of the approach, except in regions of very steep terrain.