The two American hostages, freed after months of being held hostage in Yemen's raging civil war, took their first steps to freedom down a staircase pushed against a gleaming Oman royal air force jet.

It's not the first time a scene like this has played out in recent years as the unassuming sultanate of Oman wields its influence as one of the Middle East's most useful go-to mediators of thorny disputes.

From hosting secret talks between Washington and Tehran over the Islamic Republic's contested nuclear program to seeking a negotiated resolution in Yemen, Oman has struggled to keep the peace among the much larger powers that surround it, including archrivals Saudi Arabia and Iran.

"Because of its location, and because of the very limited resources in Oman, Omanis have learned how to actually be diplomats, how to be mediate, how to connect," said Ahmed al-Mukhaini, an Omani political analyst. "This connection to the world seems to have continued and became a residue within the Omani culture."

The most recent example of Oman's diplomacy under Sultan Qaboos bin Said came Sunday night, when it announced that it had negotiated the release of two Americans, three Saudis and a British citizen held by Yemen's Shiite Houthi rebels, without elaborating on the terms of their release.

While the Saudis and the Briton have yet to be named, the New Orleans-based logistics company Transoceanic Development confirmed its employee Scott Darden was one of the Americans. The other was Sam Farran, a former U.S. Marine from Dearborn Heights, Michigan, who worked in the security industry in Yemen, his wife Zeina told Detroit's WJBK-TV.

"We are very, very relieved and thrilled that it's all over and thank God that we are over this ordeal," she said. "We can go on with our life and I can't wait for him to come home."

Oman stands apart from its Gulf Arab neighbors in not joining the Saudi-led coalition battling the Iranian-backed Houthis in Yemen. It instead has positioned itself as a quiet mediator by hosting talks involving the rebels and other parties.

It also has been involved in other hostage releases in Yemen, including that of Houthi-held American freelance journalist Casey Coombs. Also released in August was World Bank consultant Isabelle Prime, a French national who thanked Oman's sultan for aiding her release.

For Oman, there's a vital self-interest in helping neighboring Yemen end its war before the unrest seeps across the border.

"Oman considers itself a vulnerable country because it's a small country which is in the middle of many issues, like Yemen to the south, Pakistan to the north, Iran to the north and Saudi Arabia," said Marc Valeri, the director of the Center for Gulf Studies at Britain's Exeter University. "This vulernability means they want to be friendly with all the other parties around."

That doesn't stop Oman from criticizing its neighbors. On Saturday, Oman summoned Saudi Arabia's ambassador to protest what it called a coalition airstrike on its ambassador's residence in Yemen's rebel-held capital, Sanaa. Oman demanded an explanation for the "unacceptable" attack and warned that a continuation of the war "might pose a threat to the region's stability." Saudi Arabia denied carrying out the strike.

Oman, more than any of the other five Arab states that make up the Saudi Arabia-dominated Gulf Cooperation Council also has made a point of cultivating ties with its larger, non-Arab neighbor, Iran.

Oman and Iran share control of the vital Strait of Hormuz, the narrow and heavily trafficked waterway at the mouth of the Persian Gulf that is the route for nearly a third of all oil traded by sea. Qaboos has paid visits to Iran, including a 2013 trip that made him the first foreign leader to visit since President Hassan Rouhani took office.

Rouhani returned the gesture last year, solidifying billions of dollars in investment agreements. And Omani authorities have long turned a blind eye to the smuggling of goods across the strait to sanctions-saddled Iran.

Those cordial ties with the Islamic Republic have proven useful to the U.S., which does not have formal diplomatic ties with Tehran.

Oman was the first port of call for three American hikers jailed as suspected spies in Iran, and handled the bail that secured their releases in 2010 and 2011.

In the wake of their release, Oman hosted discreet meetings of American and Iranian diplomats over the following two years. While little concrete emerged from those initial talks, they helped lay the groundwork for negotiations over Iran's disputed nuclear program that culminated in this year's landmark deal.

Oman also maintains low-key but significant security and military ties to the U.S. and Britain.

And while earning the trust of other nations, Oman's diplomacy has an added benefit of masking its own problems, like who will replace the aging Qaboos, who is 74 and has no heirs.

"It's a very interesting public-relations policy: To present itself as the good guy in the region and not to attract too much attention to what's happening in the country," Valeri said.

___

Follow Jon Gambrell on Twitter at www.twitter.com/jongambrellap . Follow Adam Schreck on Twitter at www.twitter.com/adamschreck .