The magnetic dynamo cycle of the Sun features a distinct pattern: a propagating region of sunspot emergence appears around 30° latitude and vanishes near the equator every 11 years (ref. 1). Moreover, longitudinal flows called torsional oscillations closely shadow sunspot migration, undoubtedly sharing a common cause2. Contrary to theories suggesting deep origins of these phenomena, helioseismology pinpoints low-latitude torsional oscillations to the outer 5-10% of the Sun, the near-surface shear layer3,4. Within this zone, inwardly increasing differential rotation coupled with a poloidal magnetic field strongly implicates the magneto-rotational instability5,6, prominent in accretion-disk theory and observed in laboratory experiments7. Together, these two facts prompt the general question: whether the solar dynamo is possibly a near-surface instability. Here we report strong affirmative evidence in stark contrast to traditional models8 focusing on the deeper tachocline. Simple analytic estimates show that the near-surface magneto-rotational instability better explains the spatiotemporal scales of the torsional oscillations and inferred subsurface magnetic field amplitudes9. State-of-the-art numerical simulations corroborate these estimates and reproduce hemispherical magnetic current helicity laws10. The dynamo resulting from a well-understood near-surface phenomenon improves prospects for accurate predictions of full magnetic cycles and space weather, affecting the electromagnetic infrastructure of Earth.