In early April of 1970, Mr. Mattingly was in his car when a breaking news came over the radio: Jack Swigert was replacing him as command module pilot on the moon-bound flight.
“I just kind of pulled over to the side of the road and sat there for a while,” Mr. Mattingly recalled in a NASA oral history. “If this is a practical joke, it’s really well done, but I don’t think this is a joke.”
The astronaut had been exposed to German measles by Charles Duke, a backup pilot on the flight. Preflight blood tests showed Mr. Mattingly lacked immunity to the disease. NASA doctors feared he could become sick while in space.
Left on the ground while Swigert, James Lovell and Fred Haise blasted off to walk on the moon, Mr. Mattingly was relegated, in his words, to “fifth wheel” status at the mission operations center.
“I really was feeling very down, very sorry for myself,” he said in the NASA oral history.
His colleagues comforted him by keeping their distance from him.
“The nice thing was no one ever said anything,” Mr. Mattingly said. “They knew better. They just didn’t.”
On the third day of the mission, an onboard explosion knocked out power and oxygen in the command module. During the next four days – the window in which he could have but never came down with the measles – Mr. Mattingly strategized with NASA staff on plans to bring the crew safely home.
In Ron Howard’s 1995 movie “Apollo 13,” actor Gary Sinise portrayed Mr. Mattingly tinkering alone for hours in a simulator testing a plan for the astronauts to retreat to Apollo’s lunar module before shifting back to the command module to land.
Mr. Mattingly said the movie “over-embellished” his role, acknowledging that others helped him. His comrades praised his contributions, as did NASA.
“He stayed behind and provided key real-time decisions to successfully bring home the wounded spacecraft and the crew of Apollo 13,” NASA Administrator Bill Nelson said in a statement after Mr. Mattingly’s death.
Two years after he helped bring Apollo 13 home, Mr. Mattingly served as command module pilot of Apollo 16, NASA’s penultimate moon mission. As astronauts Duke and John Young explored the moon, Mr. Mattingly stayed behind in lunar orbit conducting experiments and taking photographs.
On the way back to Earth, Mr. Mattingly conducted a spacewalk to collect canisters of film and other materials.
He also found his wedding ring, which had vanished earlier in the mission.
“Normally I found I could find things after a long period of time — they’d collect on the air filters,” he recalled. “But it never showed up.”
With the hatch open, Duke said, “Look at that.”
“And there was my wedding ring floating out the door,” Mr. Mattingly recalled. “I grabbed it, and we put it in the pocket. We had the chances of a gazillion to one.”
Thomas Kenneth Mattingly II was born in Chicago on March 17, 1936, and grew up in Hialeah, Fla., near Miami. His father worked for Eastern Airlines as a mechanic and supervisor for 41 years, and his mother was a homemaker.
Father and son were master builders of paper airplanes, testing them at a park now named after the astronaut.
“They used to spend hours working on those planes and talking about what it would be like to fly,” Mr. Mattingly’s mother told the Miami Herald. “In those days, we never even dreamed of flying to space.”
Mr. Mattingly studied aeronautical engineering at Auburn University, graduating in 1958. He was commissioned in the Navy the same year and soon became a naval aviator.
In 1966, Mr. Mattingly — known as quiet and protective of his private life — was one of 19 astronauts selected in NASA’s fifth class of space explorers. His first spaceflight was aboard Apollo 16. He also served as commander on space shuttle missions in 1982 and 1985.
After logging 504 hours in space, Mr. Mattingly retired as a rear admiral and worked in the private sector for many years, primarily for aerospace companies.
Survivors include his wife, Kathleen Ruemmele Mattingly, and a son, Thomas K. Mattingly III.
The news that Mr. Mattingly was being scrubbed from the Apollo 13 flight did not sit well with the mission’s other astronauts, especially Lovell.
“How long is the incubation period for this thing?” he asked the flight surgeon, according to his 1994 book “Lost Moon,” co-written with Jeffrey Kluger.
The answer: 10 days to two weeks. Lovell did the math. Mr. Mattingly would be healthy at liftoff and on arrival to the moon.
“Then what’s the problem?” Lovell asked the flight surgeon. “If he starts running a fever when Fred and I are down on the surface, he can have that whole time to get over it. If he’s not better by then, he can just sweat it out on the flight home.”
After all, Lovell concluded, “I can’t think of a better place to have the measles than in a nice cozy spaceship.”