Water is a requirement for life as we know it1. Indirect evidence of transient liquid water has been observed from orbiter on equatorial Mars2, in contrast with expectations from large-scale climate models. The presence of perchlorate salts, which have been detected at Gale crater on equatorial Mars by the Curiosity rover3,4, lowers the freezing temperature of water5. Moreover, perchlorates can form stable hydrated compounds and liquid solutions by absorbing atmospheric water vapour through deliquescence6,7. Here we analyse relative humidity, air temperature and ground temperature data from the Curiosity rover at Gale crater and find that the observations support the formation of night-time transient liquid brines in the uppermost 5 cm of the subsurface that then evaporate after sunrise. We also find that changes in the hydration state of salts within the uppermost 15 cm of the subsurface, as measured by Curiosity, are consistent with an active exchange of water at the atmosphere–soil interface. However, the water activity and temperature are probably too low to support terrestrial organisms8. Perchlorates are widespread on the surface of Mars9 and we expect that liquid brines are abundant beyond equatorial regions where atmospheric humidity is higher and temperatures are lower.