Doping of semiconductors by impurity atoms enabled their widespread technological application in microelectronics and optoelectronics. However, doping has proven elusive for strongly confined colloidal semiconductor nanocrystals because of the synthetic challenge of how to introduce single impurities, as well as a lack of fundamental understanding of this heavily doped limit under strong quantum confinement. We developed a method to dope semiconductor nanocrystals with metal impurities, enabling control of the band gap and Fermi energy. A combination of optical measurements, scanning tunneling spectroscopy, and theory revealed the emergence of a confined impurity band and band-tailing. Our method yields n- and p-doped semiconductor nanocrystals, which have potential applications in solar cells, thin-film transistors, and optoelectronic devices.