An intense laser pulse in a plasma can accelerate electrons [1][2][3][4] to GeV energies in centimetres [5][6][7] . Transverse betatron motion 8,9 in the plasma wake results in X-ray photons with an energy that depends on the electron energy, oscillation amplitude and frequency of the betatron motion [10][11][12] . Betatron X-rays from laser-accelerator electrons have hitherto been limited to spectra peaking between 1 and 10 keV (ref. 13). Here we show that the betatron amplitude is resonantly enhanced when electrons interact with the rear of the laser pulse 14,15 . At high electron energy, resonance occurs when the laser frequency is a harmonic of the betatron frequency, leading to a significant increase in the photon energy. 10 X-ray pulses from synchrotron sources have become immensely useful tools for investigating the structure of matter 17 , which has led to a huge international effort to construct light sources for many different scientific and technological applications. Synchrotrons are usually based on radio-frequency (RF) accelerating cavities that are limited to fields of 10-100 MV m −1 because of electrical breakdown, which results in very large and expensive devices.High-power lasers, on the other hand, have led to the development of many new areas of science, as diverse as inertial confinement fusion and laboratory astrophysics to the study of warm dense matter. However, they now have the potential to transform accelerator and light source technology. In the late 1970s, Tajima and Dawson 1 proposed harnessing the ponderomotive force associated with intense laser fields to excite plasma waves and form wake-like structures 18 (as behind a boat) that travel with a velocity close to the speed of light, c. The electrostatic forces of these charge density structures can rapidly accelerate particles to very high energies 6 ; where momentum is gained analogous to a surfer riding an ocean wave. Recent progress in the development of laser wakefield accelerators (LWFAs) has enabled electron beams to be accelerated with unprecedented acceleration gradients 2-4 , three orders of magnitude higher than in RF cavities, thus reducing a 100 m long GeV accelerator to centimetres in length 6 . The LWFA can now produce high-quality electron beams with low emittance, ε n , of the order 1π mm mrad 19 , small energy spread 20 , δγ /γ 1%, where γ is the Lorenz factor, and high charge 4 , Q = 10-100 pC. At high laser intensities, in the so-called blowout regime 21 , the LWFA structure has an approximately spherical bubble shape with a radius of R ≈ 2 √ a 0 c/ω p , which is primarily determined by the normalized laser vector potential, a 0 = eA/m e c 2 and the plasma frequency, ω p = √ 4π n p e 2 /m e , where n p is the plasma density, e, the electron charge and m e , the electron mass 22 . The plasma wave is efficiently driven when the laser pulse duration is approximately a plasma period. Micrometre-long electron bunches that extend only a fraction of the plasma wavelength, λ p = 2πc/ω p , are self-injected and accelerate...