FERMI'S suggestion 1 that a population of low-energy charged particles could be accelerated by momentum exchange with 'wandering' galactic magnetic fields has long been a favoured mechanism for the generation of cosmic rays. A difficulty with this idea, however, recognized by Fermi 2 and others 3-5, is that unless the scattering centres of strong magnetic fields have velocities close to the speed of light, the acceleration mechanism is thought to be too slow to produce the highest-energy (approximately 10(20) eV) cosmic rays before particles escape from the Galaxy. We argue here that this problem is not intrinsic to the Fermi theory, but results only from approximating the essentially stochastic acceleration process as a deterministic one, in which particles diffuse upwards in energy at some mean rate. The stochastic treatment we present here suggests that the particles that acquire the highest energies are those on the wings of the statistical energy distribution, which proceed not in a pedestrian manner but are accelerated much more effectively as 'high flyers'.