Astronaut Jim Lovell, best known as the commander of the near-tragic Apollo 13 mission to the moon, died Thursday in Illinois. He was 97 years old.

Lovell was a veteran of four spaceflights: Gemini VII, Gemini XII, Apollo 8 and Apollo 13.

In a statement released Friday, the Lovell family highlighted his “amazing life and career accomplishments” and his “legendary leadership in pioneering human space flight.”

“But, to all of us, he was Dad, Granddad, and the Leader of our family. Most importantly, he was our Hero,” the family said in its statement. “We will miss his unshakeable optimism, his sense of humor, and the way he made each of us feel we could do the impossible. He was truly one of a kind.”

Acting NASA Administrator Sean Duffy said in a news release: “NASA sends its condolences to the family of Capt. Jim Lovell, whose life and work inspired millions of people across the decades. Jim’s character and steadfast courage helped our nation reach the Moon and turned a potential tragedy into a success from which we learned an enormous amount. We mourn his passing even as we celebrate his achievements.”

Lovell was selected to join NASA in 1962 as part of the agency’s second round of astronauts — a group that included Neil Armstrong, Charles “Pete” Conrad, John Young and others that were nicknamed the “Next Nine.”

Lovell’s first two spaceflights, Gemini VII and Gemini XII, were designed to demonstrate how humans could live in weightlessness and to test rendezvous and docking technologies that would be essential for subsequent space station operations.

Lovell next circled the moon on the Apollo 8 mission in 1968, but it was his fourth and final spaceflight that brought him the most fame.

The Apollo 8 lunar orbit mission astronauts, from left: James A. Lovell Jr., command module pilot; William A. Anders, lunar module pilot; and Frank Borman, commander; at the Kennedy Space Center.The Apollo 8 lunar orbit mission astronauts, from left: James A. Lovell Jr., command module pilot; William A. Anders, lunar module pilot; and Frank Borman, commander; at the Kennedy Space Center.NASA

Apollo 13 launched into space on April 11, 1970, on a mission that was intended to be NASA’s third moon landing. But 55 hours, 55 minutes and 4 seconds into the flight, disaster struck.

One of the spacecraft’s oxygen tanks exploded, causing another to fail as Lovell and his two crewmembers, John “Jack” Swigert and Fred Haise, were about 200,000 miles from Earth. It was Swigert who initially radioed the infamous message to NASA’s Mission Control: “Okay, Houston, we’ve had a problem here.”

When asked to repeat, Lovell followed up: “Houston, we’ve had a problem. We’ve had a Main B Bus Undervolt.”

Over the next three days, NASA engineers and mission controllers executed a harrowing rescue that was lauded as one of the agency’s finest achievements. The explosion crippled the command module, and the astronauts faced an extreme shortage of water and electrical power, along with dangerously high levels of carbon dioxide, according to NASA.

After about six days in space, the Apollo 13 crew splashed down safely in the Pacific Ocean. The mission came to be known as a “successful failure,” one that demonstrated the ingenuity of tenacity of the agency’s engineers and astronauts.

Lovell won praise for his steady leadership throughout the flight.

“As commander of the Apollo 13 mission, his calm strength under pressure helped return the crew safely to Earth and demonstrated the quick thinking and innovation that informed future NASA missions,” Duffy said in a statement.

The mission had receded into history until 1995 when Lovell was portrayed by Tom Hanks in “Apollo 13,” a movie that captured the danger and drama of the mission. The movie would make Lovell’s name among the most recognizable astronauts arguably only behind Armstrong and John Glenn.

Lovell was born March 25, 1928, in Cleveland. He graduated from the U.S. Naval Academy in 1962 and went on to log more than 7,000 hours of flying time.

Over the course of four spaceflights, Lovell spent 715 hours in orbit, according to NASA. He retired from the agency in 1973.

In a 2020 interview with the TODAY show, Lovell reflected on the milestones of his life as an aviator and astronaut.

“I think I’m very fortunate,” he said. “I think that I’ve lived a life that — if I had a chance to live all over again, even though if I knew what the consequences would be and the chance of coming back, you know, were not unknown at the time … I would do it.”