Mars has lost most of its once-abundant water to space, leaving the planet cold and dry. In standard models, molecular hydrogen produced from water in the lower atmosphere diffuses into the upper atmosphere where it is dissociated, producing atomic hydrogen, which is lost. Using observations from the Neutral Gas and Ion Mass Spectrometer on the Mars Atmosphere and Volatile Evolution spacecraft, we demonstrate that water is instead transported directly to the upper atmosphere, then dissociated by ions to produce atomic hydrogen. The water abundance in the upper atmosphere varied seasonally, peaking in southern summer, and surged during dust storms, including the 2018 global dust storm. We calculate that this transport of water dominates the present-day loss of atomic hydrogen to space and influenced the evolution of Mars’ climate.