Galactic cosmic rays reach energies of at least a few Peta-electronvolts (1 PeV =$10^\mathbf{15}$ electron volts). This implies our Galaxy contains PeV accelerators (PeVatrons), but all proposed models of Galactic cosmic-ray accelerators encounter non-trivial difficulties at exactly these energies. Tens of Galactic accelerators capable of accelerating particle to tens of TeV (1 TeV =$10^\mathbf{12}$ electron volts) energies were inferred from recent gamma-ray observations. None of the currently known accelerators, however, not even the handful of shell-type supernova remnants commonly believed to supply most Galactic cosmic rays, have shown the characteristic tracers of PeV particles: power-law spectra of gamma rays extending without a cutoff or a spectral break to tens of TeV. Here we report deep gamma-ray observations with arcminute angular resolution of the Galactic Centre regions, which show the expected tracer of the presence of PeV particles within the central 10~parsec of the Galaxy. We argue 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 and an outflow from the Galactic Centre. 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 $\gtrsim 10^{6-7}$ years, and therefore should be considered as a viable alternative to supernova remnants as a source of PeV Galactic cosmic rays. Comment: 29 pages, 7 figures, 3 tables, in press, for official published article see http://www.nature.com/nature/journal/v531/n7595/full/nature17147.html