Global dust storms on Mars are rare1,2 but can affect the Martian atmosphere for several months. They can cause changes in atmospheric dynamics and inflation of the atmosphere3, primarily owing to solar heating of the dust3. In turn, changes in atmospheric dynamics can affect the distribution of atmospheric water vapour, with potential implications for the atmospheric photochemistry and climate on Mars4. Recent observations of the water vapour abundance in the Martian atmosphere during dust storm conditions revealed a high-altitude increase in atmospheric water vapour that was more pronounced at high northern latitudes5,6, as well as a decrease in the water column at low latitudes7,8. Here we present concurrent, high-resolution measurements of dust, water and semiheavy water (HDO) at the onset of a global dust storm, obtained by the NOMAD and ACS instruments onboard the ExoMars Trace Gas Orbiter. We report the vertical distribution of the HDO/H2O ratio (D/H) from the planetary boundary layer up to an altitude of 80 kilometres. Our findings suggest that before the onset of the dust storm, HDO abundances were reduced to levels below detectability at altitudes above 40 kilometres. This decrease in HDO coincided with the presence of water-ice clouds. During the storm, an increase in the abundance of H2O and HDO was observed at altitudes between 40 and 80 kilometres. We propose that these increased abundances may be the result of warmer temperatures during the dust storm causing stronger atmospheric circulation and preventing ice cloud formation, which may confine water vapour to lower altitudes through gravitational fall and subsequent sublimation of ice crystals3. The observed changes in H2O and HDO abundance occurred within a few days during the development of the dust storm, suggesting a fast impact of dust storms on the Martian atmosphere.