The Van Allen radiation belts contain ultrarelativistic electrons trapped in Earth's magnetic field. Since their discovery in 1958, a fundamental unanswered question has been how electrons can be accelerated to such high energies. Two classes of processes have been proposed: transport and acceleration of electrons from a source population located outside the radiation belts (radial acceleration) or acceleration of lower-energy electrons to relativistic energies in situ in the heart of the radiation belts (local acceleration). We report measurements from NASA's Van Allen Radiation Belt Storm Probes that clearly distinguish between the two types of acceleration. The observed radial profiles of phase space density are characteristic of local acceleration in the heart of the radiation belts and are inconsistent with a predominantly radial acceleration process.