Mechanical drift is a long-standing problem in optical microscopy that occurs in all three dimensions. This drift increasingly limits the resolution of advanced surface-coupled, single-molecule experiments. We overcame this drift and achieved atomic-scale stabilization (0.1 nm) of an optical microscope in 3D. This was accomplished by measuring the position of a fiducial mark coupled to the microscope cover slip using back-focal-plane (BFP) detection and correcting for the drift using a piezoelectric stage. Several significant factors contributed to this experimental realization, including (i) dramatically reducing the low frequency noise in BFP detection, (ii) increasing the sensitivity of BFP detection to vertical motion, and (iii) fabricating a regular array of nanometer-sized fiducial marks that were firmly coupled to the cover slip. With these improvements, we achieved short-term (1 s) stabilities of 0.11, 0.10, and 0.09 nm (rms) and long-term (100 s) stabilities of 0.17, 0.12, and 0.35 nm (rms) in x, y, and z, respectively, as measured by an independent detection laser.