The nearby radio galaxy Centaurus A belongs to a class of Active Galaxies that are very luminous at radio wavelengths. The majority of these galaxies show collimated relativistic outflows known as jets, that extend over hundreds of thousands of parsecs for the most powerful sources. Accretion of matter onto the central super-massive black hole is believed to fuel these jets and power their emission, with the radio emission being related to the synchrotron radiation of relativistic electrons in magnetic fields. The origin of the extended X-ray emission seen in the kiloparsec-scale jets from these sources is still a matter of debate, although Cen As X-ray emission has been suggested to originate in electron synchrotron processes. The other possible explanation is Inverse Compton (IC) scattering with CMB soft photons. Synchrotron radiation needs ultra-relativistic electrons ($sim50$ TeV), and given their short cooling times, requires some continuous re-acceleration mechanism to be active. IC scattering, on the other hand, does not require very energetic electrons, but requires jets that stay highly relativistic on large scales ($geq$1 Mpc) and that remain well-aligned with the line of sight. Some recent evidence disfavours inverse Compton-CMB models, although other evidence seems to be compatible with them. In principle, the detection of extended gamma-ray emission, directly probing the presence of ultra-relativistic electrons, could distinguish between these options, but instruments have hitherto been unable to resolve the relevant structures. At GeV energies there is also an unusual spectral hardening in Cen A, whose explanation is unclear. Here we report observations of Cen A at TeV energies that resolve its large-scale jet. We interpret the data as evidence for the acceleration of ultra-relativistic electrons in the jet, and favour the synchrotron explanation for the X-rays.