A 32 x 32 microelectricalmechanical systems mirror is controlled in a closed-loop adaptive optics test bed with a spatially filtered wavefront sensor (WFS), Fourier transform wavefront reconstruction, and calibration of references with a high-precision interferometer. When correcting the inherent aberration of the mirror, 0.7 nm rms phase error in the controllable band is achieved. When correcting an etched phase plate with atmospheric statistics, a dark hole 10(3) deeper than the uncontrollable phase is produced in the phase power spectral density. Compensation of the mirror's influence function is done with a Fourier filter, which results in improved loop convergence. Use of the spatial filter is shown to reduce the gain variability of the WFS in a quadcell configuration.