  Oxygen vacancies are an important type of defect in transition metal oxides.
In SrTiO$_3$ they are believed to be the main donors in an otherwise intrinsic
crystal. At the same time, a relatively deep gap state associated with the
vacancy is widely reported. To explain this inconsistency we investigate the
effect of electron correlation in an oxygen vacancy (OV) in SrTiO$_3$. When
taking correlation into account, we find that the OV-induced localized level
can at most trap one electron, while the second electron occupies the
conduction band. Our results offer a natural explanation of how the OV in
SrTiO$_3$ can produce a deep in-gap level (about 1 eV below the conduction band
bottom) in photoemission, and at the same time be an electron donor. Our
analysis implies an OV in SrTiO$_3$ should be fundamentally regarded as a
magnetic impurity, whose deep level is always partially occupied due to the
strong Coulomb repulsion. An OV-based Anderson impurity model is derived, and
its implications are discussed.
