We study the numerical approximation of a singularly perturbed reaction-diffusion equation using a pth order Galerkin finite element method on a non-uniform grid. The grid is constructed by equidistributing a strictly positive monitor function which is a linear combination of a constant floor and a power of the second derivative of a representation of the boundary layers-obtained using a suitable decomposition of the analytical solution. By the appropriate selection of the monitor function parameters we prove that the numerical solution is insensitive to the size of the singular perturbation parameter and achieves the optimal rate of convergence with respect to the mesh density. (C) 2001 IMACS. Published by Elsevier Science B.V. All rights reserved.