Former Texas governor Rick Perry and former Navy SEAL Marcus Luttrell standing for the Pledge of Allegiance at the Ronald Reagan Presidential Library in Simi Valley, Calif. (Ben Price/courtesy Rick PAC)

Before he became immortalized as the “Lone Survivor,” a Navy SEAL­
who escaped a 2005 Taliban ambush on a mountain slope in Afghanistan, Marcus Luttrell was a broken man in search of a haven.

He found it one day in spring 2007 when, struggling to recover his body and mind and with the horrors of war still raw, he showed up unannounced at the Texas governor’s mansion and asked to see Rick Perry.

Over the ensuing months, a virtual father-son relationship blossomed, the two men said. The governor and his wife, Anita, helped bring Luttrell back to health. Perry used the power of his office to find Luttrell a spine surgeon to fix his back. The Perrys gave him a spare bedroom — “I was the creepy guy in the attic,” Luttrell recalled. The governor took him bass fishing, the first lady counseled him about his love life and, as Luttrell became ­famous — first with a best-selling memoir, “Lone Survivor” and ­later in the movie adaptation — they were his rock.

“When I came into the Perry family, it was one of those deals where it was the only family I had,” said Luttrell, who was born in Houston and grew up in Texas near the Oklahoma border. “I didn’t have that father figure growing up like that, somebody who genuinely cared about me. . . . Governor Perry taught me how to be a good man.”

Perry and Luttrell shared their story in an extensive interview with The Washington Post and in an appearance here Monday night at the Ronald Reagan Presidential Library. They are drawing attention to their unusual relationship as the now-former governor prepares to launch his second presidential campaign.

Gov. Rick Perry shakes hands with National Guard troops training at Camp Swift in Bastrop, Texas, in August 2014. (William Luther/AP)

Perry considers his own military career as an Air Force pilot a trump card in a Republican presidential race in which he is being crowded out of the top tier by formidable contenders. Perry is one of only two prospective candidates with a military background; the other is Sen. Lindsey O. Graham (S.C.).

“I went from being the second lieutenant going through pilot training to getting my wings to ending up as a tac airlifter to being an aircraft commander — and all those experiences paint my worldview,” Perry said in the interview.

So, too, he said, did his 14 years commanding the Texas National Guard as governor. “All of that gives me a unique perspective about what these young people go through and the impacts on themselves and, just as importantly, their families,” he said.

Highlighting his service flying C-130 cargo planes has long been a staple of Perry’s campaigns, said David Carney, a former strategist for his gubernatorial races. “It shows you’re not just a politician, but you have real-life experiences,” he said. “Texas has a huge military presence, and it really helped him relate to folks.”

Since his humiliating withdrawal from the 2012 race, Perry has been preparing for redemption in 2016 — holding lengthy tutorials with conservative scholars and logging thousands of miles in early caucus and primary states. But his work has not paid off in early polls. In an April Washington Post-ABC News survey, Perry ranked ninth — with support from just 2 percent of Republican or Republican-
leaning voters nationally.

Perry’s advisers say they think that focusing on his military background can help him break through. Foreign policy is emerging as a dominant issue as Republicans attack what they consider President Obama’s foibles and, by extension, the record of his first-term secretary of state, Hillary Rodham Clinton, who is the ­Democratic front-runner.

Mark Wahlberg, right, plays Marcus Luttrell in a scene from “Lone Survivor,” the 2013 film by Universal Pictures. (Gregory R. Peters/AP)

Perry, an adherent of muscular intervention, has sharply criticized Obama’s nuclear agreement with Iran and accused his administration of sparking chaos around the world and weakening the U.S. armed forces. Perry is likely to campaign with Luttrell and hopes the war hero’s testimonials can add a personal dimension to Perry’s national security agenda.

Luttrell, 39, deployed to Afghanistan in 2005 with Navy SEAL Team 10. As dramatized in the 2013 “Lone Survivor” movie, Luttrell was part of Operation Red Wings, a four-man mission to find and kill Ahmad Shah, a top Taliban leader in eastern Afghanistan.

A group of goat herders stumbled upon Luttrell and his team on a mountain slope. After the SEALs released them, local Taliban forces returned and ambushed the Americans. Luttrell was the only survivor. Badly wounded, he managed to evade capture, and an Afghan tribe sheltered him before he was rescued by U.S. forces.

The next year, while undergoing physical therapy at Naval Base Coronado near San Diego, ­Luttrell met Rick and Anita Perry. The Perrys, who have two grown children, were vacationing at the Hotel del ­Coronado, and Luttrell was assigned to give them what he called a “dog and pony” tour of the naval facilities.

Perry kept in touch, sending Luttrell e-mails, including throughout Luttrell’s 2006 deployment to Iraq, and extended an open invitation to visit him in Austin. Luttrell took him up on it, showing up at the security guard post outside the governor’s mansion one day. “It was a safe haven,” Perry said.

Later that year, when the Perrys moved into a temporary residence for the mansion’s renovation, they turned a third-floor space into a bedroom for Luttrell. Anita Perry (Luttrell calls her “Lady Perry”) gave him an air mattress and a television, which he liked to leave on while he slept.

“I’m not sure I can put into words how my wife and I were attracted to him or he was attracted to us,” Perry said. “I kind of put that in the ‘grace of God’ category.”

Back then, Luttrell was addicted to painkillers and had many ailments, both physical and mental. As Perry tells it, Luttrell was lost in a bureaucratic maze at the Pentagon and at the Department of Veterans Affairs. “He needed stuff done,” he said, “and all he was getting was a sack full of pills.” So Perry stepped in and called Navy Secretary Ray Mabus, who made Luttrell eligible for Tricare.

“There are 1,000-plus just like him,” Perry said. “They just didn’t have a governor to intervene. And that pisses me off.”

Luttrell, who had a poor relationship with his father, said he effectively adopted the Perrys as parents. He met Melanie, who would become his wife, in 2010, and when he introduced her to the Perrys, he recalled telling her, “That’s my family.”

The Luttrells now have two children. Their godfather is Rick Perry.