An image-tracking procedure for atomic force microscopy is proposed and tested, which allows repeated imaging of the same area without suffering from lateral drift. The drift correction procedure is based on on-line cross-correlation of succeeding images. Using the image-tracking procedure allows zooming in on a small scan area over a long period and thus increases the frame rate inversely proportional to the scan area. Application of the procedure is demonstrated for diffusion of 5.4-kb DNA plasmids. With a scan area of 500500 nm2, a single plasmid can be imaged for more than 30 min at 4 s per frame, with a drift less than 10 nm. The high temporal resolution allows detailed analysis of the diffusion of DNA molecules. A diffusion coefficient of 30 nm2/s is found for most DNA molecules, though many molecules are tempsorally pinned to the mica surface, restricting diffusion.