Complete amplitude-displacement-frequency spectra for a lever of an atomic force microscope have been measured and used to determine surface forces in air. Two ac techniques were used to measure the shift in resonant frequency of the Ni lever, as a function of separation from a mica surface. A strong, short-range force was observed for freshly prepared surfaces, implying a van der Waals interaction. A weak, long-range force was observed after exposure of the surfaces for some hours, suggestive of a capillary interaction. The long-range force appeared to contain a nonconservative element which increased on approach to the surface. The results have implications for surface-force determinations by single tip displacement scans, and for imaging with force microscopes.