On April 13, 1970, an oxygen tank on the Apollo 13 spaceship exploded. The three astronauts on board were stranded without electricity or water, floating more than 200,000 miles from the surface of the Earth. What was intended to be the third lunar landing mission quickly became a mission to stay alive. Forty-six years later, their tale has become one of the most inspiring NASA stories in history.

Apollo 13 is known as NASA’s most “successful failure.” The ship never made it to the Moon, but all three astronauts — Commander James Lovell, lunar module pilot Fred Haise, and command module pilot John Swigert — returned home alive. From the day the oxygen tank exploded until the safe landing on Earth four days later, the astronauts and NASA engineers in Houston did everything in their power to beat the odds and get everyone home alive.

While April 12 (International Space Flight Day) is the optimistic anniversary of the first man in space, April 13 is a reminder of how many things could go wrong.

Apollo 13 launched from the Kennedy Space Center in Cape Canaveral, Florida on April 11. The launch was successful, and the astronauts shot past the atmosphere into space. Fifty-six hours and 205,000 miles later, the trouble started.

The astronauts flipped on fans to stir the hydrogen and oxygen on the spacecraft. They heard a loud bang, the spacecraft vibrated, and electrical power flickered. Shortly after, thrusters began to fire on their own. Swigert radioed back to Earth: “Houston, we’ve had a problem here.”

From left: Fred Haise, Jack Swigert, and Jim Lovell. Swigert replaced Ken Mattingly days before launch.

Apollo 13’s problem was one that NASA could have predicted weeks before the launch.

On March 24, engineers at the Kennedy Space Center found an issue with one of the two tanks each holding 320 pounds of oxygen. The tank failed a fill-and-empty test because of a loose fill tube that allowed pressure to leave the tank without emptying it. The test engineers conducted three trials to fix the problem, but to no avail.

NASA officials were faced with a decision: Replace the tank in a 45-hour procedure that could delay the launch for another month, or leave the tank as is. They chose not to replace the tank.

A TV transmission from Fred Haise, screen in the upper left, just moments before disaster struck.

Shortly after the Apollo 13 crew began experiencing problems, a warning system alerted them to low voltage on one of the fuel cells. The Mission Control Center (MCC) in Houston tried to follow along, but it couldn’t rely on the data it was receiving because of a 1.8-second break in the connection between the MCC and the spaceship.

Both the crew and the MCC realized within minutes what the situation was: the oxygen tank that had previously caused problems during testing was empty, and the second oxygen tank was draining. The oxygen in the Control Module would soon be gone and so would the electricity.

The CO2 filtration system the astronauts constructed using materials at hand.

Options were limited. An hour and a half after the crew started to experience problems, the MCC told Lovell, Haise, and Swigert “we’re starting to think about the lifeboat.”

By lifeboat, mission control was referring to the lunar module, which had a day and a half’s worth of supplies on board for two astronauts. The crew needed it to sustain three astronauts for four days.

It was all hands on deck back on Earth. Flight controllers, spacecraft systems experts, and NASA’s top brass gathered to make decisions on the fly. Engineers worked on a way to remove toxic carbon dioxide from the spaceship, and flight controllers worked on the best flight plan back to Earth. The Apollo 13 couldn’t simply be turned around and brought back home after all.

After five and a half hours of deliberation, NASA chose to reroute the spaceship to the mid-Pacific. It would land at the 143rd hour since launch, 87 hours after problems had begun.

Deliberations back at the Mission Control Center.

Back on Apollo 13, the astronauts were faced with unimaginable conditions. They were on strict rations to preserve the little resources they had left. Power was turned down as low as possible, and the temperature sank to around 38 degrees Fahrenheit. But they still had to fly the ship.

The astronauts returned to the command module as they neared Earth. Like the lunar module, it was cold. Condensation clung to the walls, and it fell on Lovell, Haise, and Swigert as they reentered the atmosphere.

The Apollo 13 module entering Earth for splashdown.

Just 15 hours before Apollo 13 was scheduled to reenter the Earth’s atmosphere, the crew received instructions on how to return back to the command module from the lunar module, align the guidance system, and release the lunar module before impact.

Apollo 13 landing in the Pacific Ocean.

On April 17, the Apollo 13 command module landed in the Pacific Ocean near the island of Samoa. The astronauts left their cold container and boarded the U.S.S. Iwo Jima, and then flew to Hawaii to be reunited with their families.

Back in Houston, they celebrated with cigars. The next day, President Richard Nixon gave the Presidential Medal of Freedom — the highest civilian award — to the team.

Photos via NASA