On January 27, 1967, the Outer Space Treaty was signed by the United States, the United Kingdom, and the then-Soviet Union. It entered into force on 10 October of the same year.
The Treaty bars states party to the treaty from placing weapons of mass destruction in Earth orbit, installing them on the Moon or any other celestial body, or otherwise stationing them in outer space.
It exclusively limits the use of the Moon and other celestial bodies to peaceful purposes and expressly prohibits their use for testing weapons of any kind, conducting military maneuvers, or establishing military bases, installations, and fortifications.
Summarized from Wikipedia.

This image was downloaded from the UNOOSA website.