Exactly 50 years ago, humanity stepped foot on the surface of the Moon for the first time. It was a miracle, and one made so powerful because it was so very unlikely.

It was hailed as an incredible success. But the chance of failure was such that authorities had to prepare for the possibility of losing the astronauts.

Those preparations offer a humbling insight into how risky that mission was, and how high the stakes were.

Probably the most potent document from those preparations is the speech that would have been used to hail the bravery of the astronauts as they were left to their death on the Moon.

It was written to announce to the world that the astronauts had been lost, and that the Moon mission was a failure. After it was read, the two astronauts would be given a ceremony something like the burial at sea, but one entirely without precedent.

Apollo 11 mission: Historic first moon landing in photos Show all 19 1 /19 Apollo 11 mission: Historic first moon landing in photos Apollo 11 mission: Historic first moon landing in photos Buzz Aldrin walks on the moon in an image taken by Apollo 11 commander Neil Armstrong. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Wernher von Braun in front of the Saturn V rocket, being readied for the lunar mission, in Cape Canaveral on 10 July 1969. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The Saturn V rocket carries the Apollo 11 into space on 16 July 1969. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The crew (from left): Neil Armstrong, Michael Collins and Buzz Aldrin. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The launch control centre watches the rocket take off on 16 July 1969. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The American flag flutters as the Apollo 11 heads into space. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The interior of the landing module with its pilot, Buzz Aldrin, during the mission. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Earthrise viewed from the lunar landing module. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Flight controllers at the Space Centre in Houston as the landing module descends to the surface of the moon. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos The landing module in lunar orbit on 20 July 1969. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Buzz Aldrin's boot and footprint in lunar soil. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Buzz Aldrin standing by the US flag planted on the surface of the moon. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Crater 308 on the moon. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Buzz Aldrin’s boot print in the moon’s dust. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Aldrin deploys the passive seismic experiment package. To the left of the US flag in the background is the lunar surface television camera. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Buzz Aldrin stands next to a lunar seismometer. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Neil Armstrong works near the lunar landing module. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos Members of the Apollo 11 crew wait to be picked up by a helicopter from the USS Hornet on 24 July 1969. Nasa/EPA Apollo 11 mission: Historic first moon landing in photos US president Richard Nixon welcomes the Apollo 11 astronauts, confined to a mobile quarantine facility, aboard the USS Hornet. Nasa/EPA

The document was hidden for many years – unused, it was "quietly tucked away into the record" after the astronauts returned home, as the National Archive that now holds it notes. But over time it became public, after being revealed by the man who wrote it, and is now available for the public to read.

It was prepared in the case that the astronauts and their moon lander failed to get back to the main craft that was floating around in the Moon's orbit ready to bring them home, and contained Neil Armstrong and Buzz Aldrin's colleague Michael Collins.

In that case, it was most likely that those pioneering explorers would not lose their lives in a single spectacular moment. Instead, they would most likely be stranded, stuck 250,000 miles from Earth with no way of getting back home.

"If they couldn't [get back safely], they'd have to be abandoned on the moon, left to die there," speechwriter William Safire​ said in 1999. "The men would either have to starve to death or commit suicide."

In the end, and despite some very anxious moments, the crew would explore the lunar surface and come back down safely. That meant that, instead of announcing their loss, Nixon could instead share in the astronaut's success.

In one of the most famous moments of the mission, he spoke to them in a phone call that was beamed around the world. He recognised the triumph of their achievement, and wished them safety for their return.

"Hello, Neil and Buzz," he said during that phone call. "I'm talking to you by telephone from the Oval Room at the White House.

"And this certainly has to be the most historic telephone call ever made. I just can't tell you how proud we all are of what you've done. For every American, this has to be the proudest day of our lives. And for people all over the world, I am sure they too join with Americans in recognising what an immense feat this is. Because of what you have done, the heavens have become a part of man's world.