The synthesis conditions of SrTiO3(Co) samples in which cobalt predominantly enters the A or B sites of the perovskite ABO3 structure are found. EXAFS studies show that the Co impurity at the A site is off-center and is displaced from the site by 1.0 Å. XANES studies reveal two predominant oxidation states of Co: Co2+ at the A site and Co3+ at the B site. First-principles calculations of a number of possible cobalt-containing structural defects reveal defects whose properties are compatible with the experimentally observed Co oxidation state, its local structure, magnetic, electrical, and optical properties.