Geomagnetic jerks are abrupt changes in the second time derivative-the secular acceleration-of Earth's magnetic field that punctuate ground observatory records. As their dynamical origin has not yet been established, they represent a major obstacle to the prediction of geomagnetic field behaviour for years to decades ahead. Recent jerks have been linked to short-lived, temporally alternating and equatorially localized pulses of secular acceleration observed in satellite data, associated with rapidly alternating flows at Earth's core surface. Here we show that these signatures can be reproduced in numerical simulations of the geodynamo that realistically account for the interaction between slow core convection and rapid hydromagnetic waves. In these simulations, jerks are caused by the arrival of localized Alfven wave packets radiated from sudden buoyancy releases inside the core. As they reach the core surface, the waves focus their energy towards the equatorial plane and along lines of strong magnetic flux, creating sharp interannual changes in core flow and producing geomagnetic jerks through the induced variations in magnetic field acceleration. The ability to numerically reproduce jerks offers a new way to probe the physical properties of Earth's deep interior.