The Moon has long been thought to be highly depleted in volatiles such as water, and indeed published direct measurements of water in lunar volcanic glasses have never exceeded 50 parts per million (ppm). Here, we report in situ measurements of water in lunar melt inclusions; these samples of primitive lunar magma, by virtue of being trapped within olivine crystals before volcanic eruption, did not experience posteruptive degassing. The lunar melt inclusions contain 615 to 1410 ppm water and high correlated amounts of fluorine (50 to 78 ppm), sulfur (612 to 877 ppm), and chlorine (1.5 to 3.0 ppm). These volatile contents are very similar to primitive terrestrial mid-ocean ridge basalts and indicate that some parts of the lunar interior contain as much water as Earth's upper mantle.