A formalism for the simultaneous inversion of surface-wave phase velocity and attenuation, previously developed for Love waves, is extended in this paper to Rayleigh waves. The simultaneous inversion technique permits the specification of the intrinsic dispersion-attenuation relation that arises from linearity and causality, and takes full account of the dependence of surface-wave phase velocity and Q−1 on the real and imaginary parts of an anelastic earth structure. The formalism, including resolution analysis and extremal inversion, is applied to combined Love- and Rayleigh-wave data sets for a tectonically active and a stable continental path and to Rayleigh-wave data for a stable oceanic path. The depth to the low Q zone is 60 ± 20 km for the central Pacific, 80 ± 20 km for western North America, and 130 ± 30 km for east-central North America. Q−1 within the low-Q, low-velocity zone, however, is greater beneath western North America than beneath the central Pacific; the low-Q zone beneath east-central North America need not be a low-velocity zone at frequencies above 1 Hz. The surface-wave data cannot distinguish among several possible intrinsic dispersion-attenuation relations for the upper mantle.