Researchers analysed samples of soil collected from the Moon by the Apollo missions and found it contained water in the form of compounds called hydroxyls.
The water was most likely formed on the surface of the Moon by the constant stream of charged particles ejected from the Sun known as "solar wind", the scientists said.
The traditional view that the Moon was entirely dry has been proven incorrect in recent years, with growing evidence that icy drops of water can be found on its surface.
In 2009, a Nasa satellite slammed into a crater and threw up a plume which scientists found contained an unexpectedly high amount of ice, and small amounts of water have also been found in powder and rock in the Moon's outer layer.
But although the discoveries have proven the existence of water, the problem which has continued to baffle scientists is where it came from.
Now a new paper by researchers from the University of Tennessee suggests the water was produced on the Moon's surface rather than being delivered there by a comet or other piece of space debris.
Solar wind is a flow of particles continually flowing away from the Sun. The Earth's magnetic field deflects them away from our planet, but the Moon has no such protection.
Researchers analysed the soil samples and found that they had similar chemical properties to charged hydrogen particles found in the solar wind.
The findings suggest the hydrogen was brought to the surface of the Moon in the solar wind, and then combined with oxygen to form hydroxyls, compounds similar to water which contain one hydrogen and one oxygen atom. These were then stored in the soil.
Youxue Zhang, one of the researchers, said: "Our work shows that the 'water' component, the hydroxyl, is widespread in lunar materials, although not in the form of ice or liquid water that can easily be used in a future manned lunar base."
Lead author Yang Liu added: "This also means that water likely exists on Mercury and on asteroids such as Vesta or Eros further within our solar system. These planetary bodies have very different environments, but all have the potential to produce water."
In an accompanying comment article in the Nature Geoscience Journal Dr Marc Chaussidon of the Université de Lorraine in France wrote that the findings were "opening the door to another source of water for inner Solar System bodies".
Edited By Cen Fox Post Team