Last month, an American media executive arrived in Doha with a retired FBI agent known for his extensive contacts within the government of Qatar.

The two men had come to meet with Ghanim Khalifa al-Kubaisi, the chief of Qatar’s intelligence service, and to discuss the whereabouts of an American journalist, Peter Theo Curtis, who had been missing in Syria for nearly two years. After the pair had waited for hours at the St. Regis Hotel in Doha, Kubaisi appeared with a small entourage.

He had some good news. “We’re trying to find him,” Kubaisi told the visitors.

Weeks later, the Qataris did. On Sunday, Curtis was turned over to United Nations officials in the Syrian-held portion of the Golan Heights, near Israel. His mother issued a statement saying she was “deeply grateful” for Qatar’s help.

Although Obama administration officials noted that Curtis was released following a “direct request” by his family for Qatari assistance, in fact the tiny Persian Gulf nation had been working on the case for months at the request of the Obama administration.

Nancy Curtis, mother of American writer Peter Theo Curtis, answers questions Monday outside her home in Cambridge, Mass. Militants in Syria freed her son Sunday after holding him for nearly two years. (Brian Snyder/Reuters)

Qatar, whose relationships with Islamist groups has at times been publicly questioned by the administration, has privately become the go-to U.S. partner for indirect communications with those groups. They include Hamas, at war with Israel in the Gaza Strip for the past month, and Jabhat al-Nusra, the group that held Curtis, which the United States has designated a foreign terrorist organization and a “wholly owned subsidiary” of al-Qaeda.

Beyond the Middle East, Qatar facilitated peace talks between the United States and the Taliban in Afghanistan that ended without success last year. This spring, it helped arrange the exchange of Sgt. Bowe Bergdahl, the only U.S. service member held by the Afghan militants, for five Taliban detainees held in the U.S. military prison at Guantanamo Bay, Cuba. The five currently reside in Qatar.

Qatari officials say their country’s contributions are the natural outgrowth of their belief in nonjudgmental dialogue. A statement by the Foreign Ministry in Doha, the Qatari capital, cited its “relentless efforts” to secure Curtis’s release “out of Qatar’s belief in the principles of humanity and its keenness on the lives of individuals and their right to freedom and dignity.”

Obama administration officials don’t necessarily buy into the altruistic narrative, and some share the concern of Qatar’s Persian Gulf neighbors that it is seeking only to boost its status as a regional power far beyond its size. While Treasury Department officials have said the Qatari government no longer funds groups such as Jabhat al-Nusra, they believe that a handful of wealthy Qatari individuals continue to raise funds for Islamist groups in Syria.

But at the same time, the Obama administration has repeatedly found Qatar’s contacts useful, particularly those of its intelligence service with Jabhat al-Nusra.

Qatar and others involved in Curtis’s release insist that no ransom was paid to the militants, and they say that its leverage with the group resides to some degree in its willingness to deal with them.

Whatever the source of its influence, Qatar played the pivotal role in winning Curtis’s freedom, an effort that was given additional impetus by the appeal of the American executive, David Bradley, the chairman and owner of Atlantic Media Co., and the retired FBI agent, who spoke on the condition of anonymity because of security concerns.

The White House said Monday that the U.S. did not pay a ransom for the release of Peter Theo Curtis, an American journalist held hostage for nearly two years by an al-Qaeda-linked group in Syria. (WhiteHouse.gov)

In an interview Monday at his office at the Watergate, Bradley for the first time revealed details about his dealings with the Qataris.

Bradley said he became involved in the case after meeting a cousin of Curtis’s, Amy Rosen, at a benefit dinner last year in New York. Rosen appealed to him to help find the missing man, and Bradley agreed. Key members of the team he put on the project included his general counsel and a Syrian researcher who could monitor jihadi Web sites and translate Arabic.

Later, Bradley was introduced to the former FBI agent, who had spent his career tracking al-

Qaeda and who would come to be Bradley’s close partner.

When Bradley explained the situation over dinner, the former agent said, “We need to go to Doha.”

Several weeks after the pair first met with the Qatari intelligence chief, they flew there again to meet with him.

Their dinner at an Armenian restaurant lasted more than two hours, with the men trading stories before Kubaisi revealed his security service had found Curtis using its intelligence network. He believed he could get Curtis out of Syria without paying off the kidnappers.

“His great worry was he would be accused of paying a ransom,” Bradley said. “The U.S. government won’t pay a ransom and didn’t want him to pay a ransom. The Qataris felt they were in a box.”

The former FBI agent said the operation to free Curtis required putting Qatari intelligence operatives in harm’s way. Because of the danger, the emir of Qatar, Sheikh Tamim bin Hamad al-Thani, had to approve the mission, the former agent said.

Once the mission was approved, there was a series of complications, the former agent said; at one point, there was a plan to free Curtis in a raid using militants friendly with the Qataris. The Qataris nixed the idea.

“You’re dealing with a situation where you have so many shades of bad,” the former agent said.

The family had received ransom demands up to 25 million euros.

“We never knew if these numbers were coming from the captors themselves or greatly inflated by their intermediaries,” said Viva Hardigg, another Curtis cousin.

In the end, there would be no ransom. “If it was money, it could have been solved a long time ago,” the former agent said.

Early last week, shortly before another American journalist, James Foley, was executed by the Islamic State, Bradley and the former FBI agent received information that Curtis’s captors would release him.

The captive’s mother, Nancy Curtis, was “thrilled to hear the news, but she was cautiously optimistic until the very end,” Rosen said.

At 9:04 a.m. Saturday, Bradley received a text from Kubaisi: “Done,” with a thumbs-up emoji. Then, at 11:42 a.m., Bradley received another text from the intelligence chief: “now Peter in safe hands.”

Curtis was taken to the Golan Heights in Syria and later to Israel, where FBI agents from the bureau’s Washington Field Office were waiting for him.

Nancy Curtis got the news almost immediately, with a call from one of the FBI agents who was involved in the case. She told Curtis her son was in “good shape but very emotional.”

On Sunday, Curtis spoke to her son while he was at a hotel in Tel Aviv. She said in an interview that her son was “beyond elated.”

“Mom, they’re treating me so well,” he told her. “I am in a fantastic hotel. I can have a beer. There are women here.”

Curtis said she can’t wait for him to get home. “I am going to confiscate his passport,” she said.