G igaelectron volt (GeV) electron accelerators are essential to synchrotron radiation facilities and free-electron lasers, and as modules for high-energy particle physics. Radiofrequency-based accelerators are limited to relatively low accelerating fields (10−50 MV m −1), requiring tens to hundreds of metres to reach the multi-GeV beam energies needed to drive radiation sources, and many kilometres to generate particle energies of interest to high-energy physics. Laser-wakefield accelerators 1,2 produce electric fields of the order 10-100 GV m −1 enabling compact devices. Previously, the required laser intensity was not maintained over the distance needed to reach GeV energies, and hence acceleration was limited to the 100 MeV scale 3-5. Contrary to predictions that petawatt-class lasers would be needed to reach GeV energies 6,7 , here we demonstrate production of a high-quality electron beam with 1 GeV energy by channelling a 40 TW peak-power laser pulse in a 3.3-cm-long gas-filled capillary discharge waveguide 8,9. Although it is straightforward to achieve acceleration gradients of 10−100 GV m −1 in laser-wakefield accelerators 1,2 , until recently the electron beams (e-beams) from such accelerators had energies <200 MeV with 100% energy spread 10. A breakthrough improvement in energy spread was obtained in 2004 by three groups 3-5 by interacting intense laser pulses with millimetre-scale gas jets to generate 70-200 MeV beams with percent level energy spread. For example, by using relatively large spot sizes, r s = 18 μm (1/e 2 radius of the laser intensity profile), 170 MeV e-beams were produced in 1-2-mm-long gas jets with the order of 0.5 nC bunch charge using 30 fs, 30 TW laser pulses 5. Using a 2-mm-long preformed plasma channel 2 in a gas jet to guide the driving laser beam 4,11,12 , enabled the production of 85 MeV e-beams containing 0.3 nC bunch charge, with only 9 TW of laser peak power. To scale laser-driven accelerators to GeV electron energies and beyond, two approaches had been proposed: (1) operate in initially uniform plasmas 7,13 with petawatt (PW)-scale lasers and large laser spot sizes, or (2) channel guide the laser beam over centimetre-scale distances 2,14,15. Without guiding (for example, without self-focusing or preformed channels), the laser-plasma interaction length is