The proton, one of the components of atomic nuclei, is composed of fundamental particles called quarks and gluons. Gluons are the carriers of the force that binds quarks together, and free quarks are never found in isolation—that is, they are confined within the composite particles in which they reside. The origin of quark confinement is one of the most important questions in modern particle and nuclear physics because confinement is at the core of what makes the proton a stable particle and thus provides stability to the Universe. The internal quark structure of the proton is revealed by deeply virtual Compton scattering1,2, a process in which electrons are scattered off quarks inside the protons, which subsequently emit high-energy photons, which are detected in coincidence with the scattered electrons and recoil protons. Here we report a measurement of the pressure distribution experienced by the quarks in the proton. We find a strong repulsive pressure near the centre of the proton (up to 0.6 femtometres) and a binding pressure at greater distances. The average peak pressure near the centre is about 1035 pascals, which exceeds the pressure estimated for the most densely packed known objects in the Universe, neutron stars3. This work opens up a new area of research on the fundamental gravitational properties of protons, neutrons and nuclei, which can provide access to their physical radii, the internal shear forces acting on the quarks and their pressure distributions.