Galactic cosmic rays reach energies of at least a few petaelectronvolts(1) (of the order of 1015 electronvolts). This implies that our Galaxy contains petaelectronvolt accelerators ('PeVatrons'), but all proposed models of Galactic cosmic-ray accelerators encounter difficulties at exactly these energies(2). Dozens of Galactic accelerators capable of accelerating particles to energies of tens of teraelectronvolts (of the order of 10(13) electronvolts) were inferred from recent gamma-ray observations(3). However, none of the currently known accelerators-not even the handful of shell-type supernova remnants commonly believed to supply most Galactic cosmic rays-has shown the characteristic tracers of petaelectronvolt particles, namely, power-law spectra of.-rays extending without a cut-off or a spectral break to tens of teraelectronvolts(4). Here we report deep.-ray observations with arcminute angular resolution of the region surrounding the Galactic Centre, which show the expected tracer of the presence of petaelectronvolt protons within the central 10 parsecs of the Galaxy. We propose that the supermassive black hole Sagittarius A* is linked to this PeVatron. Sagittarius A* went through active phases in the past, as demonstrated by X-ray outbursts(5) and an outflow from the Galactic Centre(6). Although its current rate of particle acceleration is not sufficient to provide a substantial contribution to Galactic cosmic rays, Sagittarius A* could have plausibly been more active over the last 10(6)-10(7) years, and therefore should be considered as a viable alternative to supernova remnants as a source of petaelectronvolt Galactic cosmic rays.