Semiconductor heterostructures provide an ideal platform for studying high-mobility, low-density electrons in reduced dimensions1, 2, 3, 4. The realization of superconductivity in heavily doped diamond5, silicon6, silicon carbide7 and germanium8 suggests that Cooper pairs eventually may be directly incorporated in semiconductor heterostructures9, but these newly discovered superconductors are currently limited by their extremely large electronic disorder. Similarly, the electron mean free path in low-dimensional superconducting thin films is usually limited by interface scattering, in single-crystal or polycrystalline samples, or atomic-scale disorder, in amorphous materials, confining these examples to the extreme 'dirty limit'10. Here we report the fabrication of a high-quality superconducting layer within a thin-film heterostructure based on SrTiO3 (the first known superconducting semiconductor11). By selectively doping a narrow region of SrTiO3 with the electron-donor niobium, we form a superconductor that is two-dimensional, as probed by the anisotropy of the upper critical magnetic field. Unlike in previous examples, however, the electron mobility is high enough that the normal-state resistance exhibits Shubnikov–de Haas oscillations that scale with the perpendicular field, indicating two-dimensional states. These results suggest that delta-doped SrTiO3 provides a model system in which to explore the quantum transport and interplay12 of both superconducting and normal electrons. They also demonstrate that high-quality complex oxide heterostructures can maintain electron coherence on the macroscopic scales probed by transport, as well as on the microscopic scales demonstrated previously13.