In laser-plasma-based accelerators1, an intense laser pulse drives a large electric field (the wakefield) which accelerates particles to high energies in distances much shorter than in conventional accelerators. These high acceleration gradients, of a few hundreds of gigavolts per metre, hold the promise of compact high-energy particle accelerators. Recently, several experiments have shown that laser-plasma accelerators can produce high-quality electron beams, with quasi-monoenergetic energy distributions at the 100 MeV level2, 3, 4. However, these beams do not have the stability and reproducibility that are required for applications. This is because the mechanism responsible for injecting electrons into the wakefield is based on highly nonlinear phenomena5, and is therefore hard to control. Here we demonstrate that the injection and subsequent acceleration of electrons can be controlled by using a second laser pulse6. The collision of the two laser pulses provides a pre-acceleration stage which provokes the injection of electrons into the wakefield. The experimental results show that the electron beams obtained in this manner are collimated (5 mrad divergence), monoenergetic (with energy spread <10 per cent), tuneable (between 15 and 250 MeV) and, most importantly, stable. In addition, the experimental observations are compatible with electron bunch durations shorter than 10 fs. We anticipate that this stable and compact electron source will have a strong impact on applications requiring short bunches, such as the femtolysis of water7, or high stability, such as radiotherapy with high-energy electrons8, 9 or radiography10 for materials science.