Laser-plasma accelerators (LPAs) are capable of accelerating charged particles to very high energies in very compact structures. In theory, therefore, they offer advantages over conventional, large-scale particle accelerators. However, the energy gain in a single-stage LPA can be limited by laser diffraction, dephasing, electron-beam loading and laser-energy depletion. The problem of laser diffraction can be addressed by using laser-pulse guiding and preformed plasma waveguides to maintain the required laser intensity over distances of many Rayleigh lengths; dephasing can be mitigated by longitudinal tailoring of the plasma density; and beam loading can be controlled by proper shaping of the electron beam. To increase the beam energy further, it is necessary to tackle the problem of the depletion of laser energy, by sequencing the accelerator into stages, each powered by a separate laser pulse. Here, we present results from an experiment that demonstrates such staging. Two LPA stages were coupled over a short distance (as is needed to preserve the average acceleration gradient) by a plasma mirror. Stable electron beams from a first LPA were focused to a twenty-micrometre radius--by a discharge capillary-based active plasma lens--into a second LPA, such that the beams interacted with the wakefield excited by a separate laser. Staged acceleration by the wakefield of the second stage is detected via an energy gain of 100 megaelectronvolts for a subset of the electron beam. Changing the arrival time of the electron beam with respect to the second-stage laser pulse allowed us to reconstruct the temporal wakefield structure and to determine the plasma density. Our results indicate that the fundamental limitation to energy gain presented by laser depletion can be overcome by using staged acceleration, suggesting a way of reaching the electron energies required for collider applications.