The energies for the ground and excited states of a D0 impurity located at the center of a GaAs/Ga1−xAlxAs spherical quantum dot are calculated, in the effective-mass approximation, as functions of the dot radius R and spatial size. We use a variational procedure and take linear combinations of Gaussian and Slater orbitals for the impurity-envelope wave functions. A model barrier potential is proposed to study changes in the potential introduced by diffusion effects. The binding energy of a 1s2-like D−; impurity is also studied by considering a parabolic correlation factor. It is found that the D0 and D−; binding energies increase as the dot size decreases up to a critical dot radius R = Rc and then, for R slightly smaller than Rc, the impurity wave function spreads to the barrier region and the 3D character is rapidly restored. The critical dot radius R = Rc is estimated by using the uncertainty relations.