We present a simple and robust way to reject out-of-focus background when performing deep two-photon excited fluorescence (TPEF) imaging in thick tissue. The technique is based on the use of a deformable mirror (DM) to introduce illumination aberrations that preferentially degrade TPEF signal while leaving TPEF background relatively unchanged. A subtraction of aberrated from unaberrated images leads to background rejection. We present a heuristic description of our technique, which we corroborate with experiment. An added benefit of our technique is that it leads to somewhat improved image resolution.