A tight-binding formalism for calculating the wave functions associated with deep levels in semiconductors, including lattice relaxation effects, is presented. This formalism is an extension of the theory of Ren et al. [Phys. Rev. B 26, 951 (1982)] to include lattice relaxation. It combines a Green's-function method for computing the wave function with the results of a previously discussed molecular-dynamics technique for calculating the relaxation around an impurity. The results of applying this scheme to substitutional impurities in Si, GaP, and GaAs are presented and compared with experiment.