Fluid inclusions trapped in ancient halite can contain a community of halophilic prokaryotes and eukaryotes that inhabited the surface brines from which the halite formed. Long-term survival of bacteria and archaea and preservation of DNA have been reported from halite, but little is known about the distribution of microbes in buried evaporites. Here we report the discovery of prokaryotes and single-celled algae in fluid inclusions in Pleistocene halite, up to 2.26 Ma in age, from the Qaidam Basin, China. We show that water activity (alpha(w)), a measure of water availability and an environmental control on biological habitability in surface brines, is also related to microbe entrapment in fluid inclusions. The alpha(w) of Qaidam Basin brines progressively decreased over the last similar to 1 million years, driven by aridification of the Asian interior, which led to decreased precipitation and water inflow and heightened evaporation rates. These changes in water balance produced highly concentrated brines, which reduced the habitability of surface lakes and decreased the number of microbes trapped in halite. By 0.13 Ma, the alpha(w) of surface brines approached the limits tolerated by halophilic prokaryotes and algae. These results show the response of microbial ecosystems to climate change in an extreme environment, which will guide future studies exploring deep life on Earth and elsewhere in the Solar System.