The first planned crewed Apollo mission, Apollo 1, ended in tragedy in 1967. All three crew members died in a fire inside their capsule during a pre-launch test on the launch pad.
NASA said design changes after the accident made the Apollo spacecraft safer for journeys to the moon.
By July 1969, NASA astronauts had flown to the moon's orbit twice, and the crew of Apollo 11 was ready to attempt a landing on the lunar surface.
The first two crewed missions to the moon flew astronauts into the moon's orbit (Apollo 8) and 50,000 feet above the lunar surface (Apollo 10.)
The Apollo team practiced their moon-landing plan on Earth first. They flew this Lunar Landing Research Vehicle for the first time in 1964.
The flights didn't always go smoothly: Neil Armstrong was at the helm in 1968 when he had to eject himself seconds before it crashed.
Armstrong also practiced what it would be like to step foot on the moon and how to get back into the lunar landing module, called the Eagle.
In 1962, President Kennedy said the US was spending 50 cents per week "for every man, woman, and child in the United States" on the space program. It took another seven years after that statement for humans to land on the moon.
On the morning of July 16, 1969, the 363-foot-tall Saturn V rocket launched from Complex 39 at the Kennedy Space Center in Florida.
The rocket used 7.5 million pounds of thrust to get the astronauts into space.
People camped out on beaches and roads nearby to see the rocket blast off.
Former President Lyndon B. Johnson and sitting Vice President Spiro Agnew were there to see the three astronauts off.
After launch, the three astronauts inside the spacecraft spent four days traveling to the moon.
Finally, command pilot Michael Collins lined up the hatches of the Columbia spacecraft and Eagle moon lander so that Aldrin and Armstrong could head down to the moon.
Things got a little chaotic during the landing: The guidance computer crashed, and Armstrong had to change the landing site at the last minute. But the astronauts landed on the moon safely after a few tense minutes. Aldrin snapped this shot of his crewmate Armstrong.
AtÂ 10:56 p.m.Â ET on July 20, Armstrong stuck his boot into the soft gray regolith dust of the moon and uttered the famous words: "Thatâs one small step for man, one giant leap for mankind."
Armstrong described the moon's surface as "fine and powdery."
"I can pick it up loosely with my toe," he said, mentioning that the regolith was kind of messy and adhered "like powdered charcoal to the sole and sides of my boots."
On Earth, mission control celebrated the successful landing.
Minutes later, Aldrin got out of the Eagle lander and joined Armstrong on the moon, joking that he was "making sure not to lock it on my way out."
The two spent two and a half hours collecting samples, taking pictures, and of course, planting this flag.
Some of the equipment the astronauts brought to the moon was designed for experiments.
The gear included a Swiss aluminum-foil panel for monitoring solar wind, four seismometers, and a reflector toward which scientists on Earth could shoot laser beams.
Aldrin called the moonscape a scene of "magnificent desolation."
This is the farthest the astronauts wandered from their lander.
The Eagle moon lander wasn't built to fly back to Earth. Instead, the vehicle rocketed Aldrin and Armstrong back to the command module Columbia, where Collins was waiting for them in orbit. The three caught this glimpse of the moon as they headed home.
The Eagle lander was then left in lunar orbit after the astronauts hopped back in their main capsule.
"It is assumed that it crashed into the lunar surface sometime within the following one to four months," NASA said.
On July 24, the Apollo 11 astronauts plunked down in the waters of the Pacific near Hawaii.
Then they waited for a helicopter to get them.
Because scientists weren't sure what kind of "lunar contagions" the astronauts might have brought back, the three were quarantined for 21 days. But President Richard Nixon stopped by to say hi.
So did their wives, of course.
On August 13, the day the astronauts were allowed back outside, they were showered with ticker tape in New York City.
The New York Times said the confetti was "so dense that the astronauts could hardly see."
The US spent two and a half more years shuttling men to the moon. The last Apollo flight ended in December 1972. Since then, NASA has explored the moon as well as other planets, like Mars, using rovers and cameras, but not with any human crews.
For the past two decades, NASA has also invested $100 billion into the International Space Station.
Source: Business Insider
But many astronauts say the main reasons no humans have touched the moon (or any other planet) since 1972 aren't scientific or technical challenges. Instead, it's due a lack of cash and political waffling.
"American leadership is inspiring the world by consistently doing what no other nation is capable of doing," Aldrin told Congress in 2015. "We demonstrated that for a brief time 45 years ago. I do not believe we have done it since."
Update: This story was originally published on July 20, 2018.