Fast electron acceleration and velocity diffusion are investigated in wavepackets formed by large-amplitude waves with relativistic phase velocities. In tokamaks, such waves are generated, e.g. in current drive by free-electron lasers where large-amplitude electron plasma waves or lower hybrid waves are generated. At small field intensities, the velocity diffusion in wavepackets with Gaussian-like envelopes is found to be well described by the quasilinear approximation. At large field intensities, trapping effects become important, and deviations from quasilinear diffusion are found. It is demonstrated that these deviations may have a significant effect on the velocity distribution of the electrons. A wave-induced runaway-like phenomenon of relativistic electrons is discussed.