We present the theory for wave equation inversion of dispersion curves, where the misfit function is the sum of the squared differences between the wavenumbers along the predicted and observed dispersion curves. Similar to wave-equation travel-time inversion, the complicated surface-wave arrivals in traces are skeletonized as simpler data, namely the picked dispersion curves in the (kx,ω) domain. Solutions to the elastic wave equation and an iterative optimization method are then used to invert these curves for 2D or 3D velocity models. This procedure, denoted as wave equation dispersion inversion (WD), does not require the assumption of a layered model and is less prone to the cycle skipping problems of full waveform inversion (FWI). The synthetic and field data examples demonstrate that WD can accurately reconstruct the S-wave velocity distribution in laterally heterogeneous media.