The first four days of Apollo 11's journey to the Moon had gone according to plan, but just twenty minutes before landing, the atmosphere grew tense as the crew encountered a series of problems.
It was July 20, 1969, and as the world followed the spacecraft's progress, it briefly lost radio contact with mission control in Houston.
Then, as the lunar module Eagle was in the middle of its descent, piloted by Edwin "Buzz" Aldrin and mission commander Neil Armstrong, an alarm bell began ringing.
Eagle had detached two hours earlier from the main part of the vessel, the command module, Columbia, where the third crew member Michael Collins remained in orbit.
It was an anxious moment for Armstrong, a brilliant test pilot and aeronautical engineer, but a man of famously few words.
"Give us a reading on the 1202 Program Alarm," he radios to mission control. They are told to keep going. Houston realizes the onboard computer is experiencing an overflow, but all systems are functional.
Below them, the Moon's craters are zipping by fast. Too fast, realizes Armstrong: at this rate, they will overshoot the landing site by several miles.
He switches to manual control and starts to scope out a new landing site from his porthole. But there's trouble finding the perfect spot, and it's going to be tight.
"Pretty rocky area," he tells Aldrin.
Aldrin continues to tell him speed and altitude readings from the computer. "Coming down nicely," he says.
"Gonna be right over that crater," Armstrong replies.
Meanwhile, the fuel is rapidly depleting.
Houston continues to announce the number of seconds left to the "Bingo fuel call" -- the point at which Eagle will have 20 seconds left to land, or abort the mission.
It is now 30 seconds left to Bingo.
Armstrong, summoning all his experience, is silent as he concentrates.
The module comes to a rest on the ground. "Contact Light," says Aldrin, meaning one of the leg's foot sensors has touched down. The engines are switched off.
"Houston, Tranquility Base here. The Eagle has landed," announces Armstrong.
"We copy you on the ground. You got a bunch of guys about to turn blue. We're breathing again. Thanks a lot," replies Charlie Duke, the CapCom or capsule communicator on the ground.
- Nazi rocket man -
History records that the number of people who worked on the Apollo program was 400,000. But two figures tower above the rest for their contributions.
In 1961, President John F Kennedy called upon his vice president Lyndon Johnson to beat the Soviets in space.
"We are in a strategic space race with the Russians, and we are losing," Kennedy had written in a magazine the year before. "If a man orbits Earth this year, his name will be Ivan."
Johnson reaches out to the godfather of NASA's space program: Wernher von Braun.
The former card-carrying Nazi was the inventor of the V-2 rockets that rained destruction on London in World War II.
Toward the end of the war, he surrendered himself to the Americans, who brought him and a hundred of his best engineers to Alabama, as part of the secret "Operation Paperclip."
Von Braun told Johnson that while the US was well behind, they could conceivably beat the Russians when it came to putting men on the Moon, if they immediately started work on a giant booster rocket.
Kennedy would address Congress later that year, famously committing "to landing a man on the Moon and returning him safely to the Earth" by the decade's end.
Eight years later, Richard Nixon was president when the goal was realized.
In case of a tragedy, he had prepared the following remarks: "Fate has ordained that the men who went to the Moon to explore in peace will stay on the moon to rest in peace."
But the extraordinary national efforts paid off.
It all happened fast, thanks to a blank check for the mission from Congress. Between October 1968 and May 1969, four preparatory Apollo missions were launched. Armstrong was chosen in December 1968 to command the eleventh.
Months from launch, Armstrong told Aldrin he was pulling rank and would be the first to set foot on the lunar surface.
"I kept my silence several more days, all the time struggling not to be angry with Neil," Aldrin later recalled in his memoirs.
"After all, he was the commander and, as such, the boss."
- The giant leap -
When the monstrous rocket designed by von Braun launched with the Apollo 11 capsule at its summit on Wednesday, July 16 1969, one million people flocked to the beach across from Cape Canaveral to watch.
But many had doubts that they'd succeed in landing on the Moon on the first attempt. Armstrong confided in 1999: "My gut feeling was that we had a 90 percent chance -- or better -- of getting back safely, and a 50 percent chance of making a successful landing."
For those in America, the final descent would take place on Sunday evening.
In Europe, it was already nighttime, but everyone was glued to their televisions, though they could only hear crackling radio communications until Armstrong set up his black and white camera ahead of his first step.
His grandmother had advised him not to do it if he felt danger; he had agreed, according to the book "Rocket Men" by Craig Nelson.
As he climbed down to the foot of the ladder, he observed that Eagle's footpads had sunk into the ground by only an inch or two, and the surface appeared very fine grained. "It's almost like a powder," he recalled.
Then, over the radio: "Okay. I'm going to step off the LM now." A pause, and then the immortal words: "That's one small step for man; one giant leap for mankind."
According to Armstrong, the line wasn't scripted. "I thought about it after landing," he would say in an oral history recorded by NASA in 2001.
One problem: without the indefinite article ("a man"), it wasn't grammatically correct. Armstrong said he meant to say it, but agreed it was inaudible.
What does the Moon look like, up close?
Its color varies with the angle of the Sun: from brown to grey to black as coal. And the lower level of gravity takes getting used to.
"I started jogging around a bit, and it felt like I was moving in slow motion in a lazy lope, often with both of my feet floating in the air," Aldrin wrote in a book in 2009.
Over the course of two-and-a-half hours, Armstrong picks up piles and piles of Moon rocks and takes photographs. Aldrin installs a seismometer and two other scientific instruments.
They plant the US flag, and leave behind a host of items including a medal honoring the first man in space, Russia's Yuri Gagarin.
Of the 857 black and white photos, and 550 in color, only four show Armstrong. The majority are of Aldrin. "He's a lot more photogenic than I am," he joked in 2001.
- Homeward bound -
By the time they were set to go, the astronauts were covered in dust. In the cockpit, "It smelled, to me, like wet ashes in a fireplace," said Armstrong.
Collins had been waiting up in orbit for the past 22 hours.
"My secret terror for the last six months has been leaving them on the moon and returning to Earth alone," he later wrote.
"If they fail to rise from the surface, or crash back into it, I am not going to commit suicide; I am coming home, forthwith, but I will be a marked man for life and I know it."
Happily, the lunar module's engine worked, it rendezvoused back with Columbia, and the trio began the long journey home.
By the end, shorn of its extra modules and fuel, the capsule weighs only 12,250 pounds, or 0.2 percent of the launch weight of the fully loaded Saturn V rocket.
On July 24, it enters the atmosphere, becoming for a while a fireball in the sky before deploying three parachutes and splashing down safely into the Pacific.
The US had dispatched an aircraft carrier to recover them. Nixon was on board.
Elite divers extract the men, who are unharmed but malodorous after their journey, to transfer them by helicopter to the ship.
There, they are placed in quarantine over the fear at the time that they may be contaminated with extraterrestrial microorganisms.
At their first press conference, three weeks later, reporters asked the three men, now global heroes, whether they would ever consider returning to the Moon.
"In the Lunar Receiving Laboratory, we had very little time for meditation," replied Armstrong, ever to the point.
None of them would go back to space ever again.
After six more missions, the Apollo program was terminated in 1972.
It was not until Donald Trump came to office that the US would decide to return to the Moon, under the Artemis program, named for Apollo's twin sister.