The Crab nebula is one of the most studied cosmic particle accelerators, shining brightly across the entire electromagnetic spectrum up to very high-energy gamma rays. It is known from radio to gamma-ray observations that the nebula is powered by a pulsar, which converts most of its rotational energy losses into a highly relativistic outflow. This outflow powers a pulsar wind nebula (PWN), a region of up to 10~light-years across, filled with relativistic electrons and positrons. These particles emit synchrotron photons in the ambient magnetic field and produce very high-energy gamma rays by Compton up-scattering of ambient low-energy photons. While the synchrotron morphology of the nebula is well established, it was up to now not known in which region the very high-energy gamma rays are emitted. Here we report that the Crab nebula has an angular extension at gamma-ray energies of 52 arcseconds (assuming a Gaussian source width), significantly larger than at X-ray energies. This result closes a gap in the multi-wavelength coverage of the nebula, revealing the emission region of the highest energy gamma rays. These gamma rays are a new probe of a previously inaccessible electron and positron energy range. We find that simulations of the electromagnetic emission reproduce our new measurement, providing a non-trivial test of our understanding of particle acceleration in the Crab nebula.