It took just a few hours after Hamas's assault on Israel for Qatar's prime minister to assemble a team at an undisclosed location in the capital, Doha. As the images emerged of missile attacks, gunmen on motorbikes and hostages seized across the border from Gaza, the Gulf state's leadership knew what it needed to do.
As the days unfolded from October 7, the round-the-clock operation worked the phone lines - one to Hamas, another to the Israelis - to mediate as retaliatory bombs rained on Gaza, according to a person familiar with the negotiations.
For Qatar, it was a case of cometh the hour, cometh the country. The nation has spent more than a decade trying to position itself as the Middle East's indispensable go-between, criticized by its neighbours for housing Hamas leaders while maintaining channels to Israel. The time had come to step up.
It's that status in an unstable region that Qatar sees as key to the security of the tiny peninsula, sandwiched between the two great rivals Saudi Arabia and Iran. The crisis in Gaza - with Israel launching a ground invasion at the weekend - has now become the ultimate test of Qatar's ability to show its Western allies they need it as much as it needs them.
"Qatar has wanted to play a useful role for important states for a very long time," said David Roberts, an associate professor at King's College London who worked in Qatar and specializes in Middle East security. "It gives Qatar a certain influence on one of the central questions in the Arab world, building up relations with this very important group in Gaza - like it or loathe it."
In a soft-power play backed by its $475 billion sovereign wealth fund, the gas-rich nation put itself on the international stage. Over the years, it invested in companies like Barclays Plc and Volkswagen AG, bought Paris Saint-Germain football club and hosted the World Cup. Its Doha-based broadcaster, Al Jazeera, also helped put it on the map.
Meanwhile, Qatar sought diplomatic influence with everyone. It's had on-off trade ties with Israel since 1996, even though it doesn't have formal diplomatic relations with the Jewish state. It liaised with the Taliban in Afghanistan - hosting them in exile - and helped mediate the release of American prisoners from Iran.
In 2022, US President Joe Biden added Qatar to the list of major non-NATO allies. Qatar also helped negotiate the release of Ukrainian children taken by Russia following its invasion later that year.
Yet, its involvement with Hamas, designated a terrorist organization by the US, UK and European Union, and backing the since-banned Muslim Brotherhood in Egypt drew anger in the Middle East. For officials in Doha, it's about being a useful and reliable partner, according to one of the people close to them, and getting a place at the table with international power brokers.
"They can't have it both ways - they can't say 'we're this bridge' and then show no signs they can actually influence Hamas," said Dennis Ross, who served as the White House Middle East envoy under President Bill Clinton and is now a senior adviser at WestExec Advisors. "The onus is on them to get more hostages out. Qatar needs to deliver something here."
The team of experts put together by Prime Minister Mohammed bin Abdulrahman Al Thani, a member of the ruling family that runs Qatar, are the same people who have mediated in the war of attrition between Israel and Hamas for more than five years. The political conversations have been ongoing, according to the person familiar with the negotiations. They declined to be identified given the fraught nature of the potentially widening conflict.
Hamas operatives entered Israel on October 7, killing 1,400 people and taking hostages to Gaza. Israel hit back with airstrikes, and then on Saturday, Prime Minister Benjamin Netanyahu said the response had entered a "second stage," with troops and tanks moving into the Gaza Strip. The Hamas-run Health Ministry says more 8,000 people have died, while the United Nations puts the number of displaced Palestinians at over 1 million.
When Hamas struck, the Qataris didn't have any knowledge that the attack was going to happen, nor did they know the scale of the hostage-taking, according to the source briefed on the matter. That became clearer as they worked the phones with both sides. The number was almost 200, since updated to 229 by the Israeli military.
Getting the first four hostages safely out of Gaza was intensified by bombs killing civilians and opposing sides making provocative statements and threatening to derail progress, according to the person briefed.
Two captives, both elderly women who lived on a kibbutz that was overrun by Hamas in the raid, were freed from Gaza on Oct. 23, and turned over to the International Committee of the Red Cross. That came three days after an American mother and her daughter were released in a deal mediated by Qatar. The efforts won praise from the US and Israel.
"I really can't go into any details about what we're doing, how we're doing it," US Secretary of State Antony Blinken had told a news conference a few days earlier. "All I can say with regard to Qatar is, in this instance, we very much appreciate their assistance." Israel's national security adviser, Tzahi Hanegbi, later said Qatar's "diplomatic efforts are crucial at this time."
Qatar's journey to critical partner hasn't been short of controversy. The Four Seasons hotel in Doha recently had to dispel claims it was putting up a Hamas leader. The group, however, has no technical office in Doha, and leaders are housed in villas.
A country smaller than Connecticut, Qatar survived a near three-year boycott by its Gulf neighbors, led by Saudi Arabia. They severed ties and transportation links, accusing Doha of supporting extremist groups and cozying up to Iran. Qatar, which described the action as an illegal siege, denied the charges.
The rift shaped and emboldened the country, which hosts US and Turkish military bases, to look at a future beyond the Gulf Cooperation Council, the six-member group dominated by the Saudis and United Arab Emirates. And at the heart of its thinking has always been its own security.
Should the latest conflict draw in Iran and the US, there could be a closure of the Strait of Hormuz, through which one-fifth of the world's daily oil supplies pass. That could block Qatar from selling its gas, and obstruct other Gulf exporters. There's also the potential for broader disruption hitting the Red Sea and Suez Canal, which accounts for around 12% of world trade.
Doha forged new links and strengthened ties with allies during its isolation. A mutual feeling of distrust with its neighbors and regional insecurities prompted many of Qatar's engagements. Now everyone's talking to the Qataris.
"The centrality of foreign policy in Qatari thinking cannot be ignored," said Bader Al-Saif, an assistant professor at Kuwait University and a non-resident fellow at the Arab Gulf States Institute in Washington. "It has led to an enhanced Qatari 'mediation product' that has proven invaluable to much of the crises of the past years. More is expected from it in connection to Gaza."
That foreign policy is underpinned by its staggering wealth, derived from the gas field it shares with Iran. It's among the world's biggest exporters of liquefied natural gas, which the nation ships to terminals in Asia and Europe. That position was enhanced following Russia's invasion of Ukraine, as European nations quickly sought new energy sources. Qatar's exports hit a record.
Few nations are as rich, or flex their financial muscle abroad as much. Per-capita gross domestic product in Qatar is roughly $82,000, more than double that of Saudi Arabia and up there with the likes of Switzerland, Singapore and Norway. Qataris own $824 billion of assets overseas, equivalent to an average of about $2 million for every Qatari citizen.
For Qatar, its utility at a moment of maximum geopolitical risk is also a reflection of its leadership.
The 43-year-old emir, Sheikh Tamim bin Hamad Al Thani, took control of the country in 2013 after his father abdicated. Under Al Thani senior, the country started using its wealth to buy influence, investing politically as well as financially.
The year before he stepped down, the father became the first head of state to visit Gaza since Hamas took over the coastal enclave in 2007 after a battle with Palestinian group Fatah. Placards bore his face after $400 million of investment in the strip.
The current emir has been a more delicate operator, according to a person familiar with his strategy. Sheikh Tamim's modus operandi is based on close, personal relationships, and the team around him maintain links with different operatives, according to the person.
"Qatar views this role as part of its national security," said Al-Saif at Kuwait University. "A secure region is in the interest of all, especially small states with the ability to successfully play an outsized role like Qatar has been doing."
With that has come a foreign policy that's still shown it can irk allies and neighbors. Qatar found itself on the opposite side of the UAE in a proxy war in Libya, and was supportive of Islamist movements in Egypt and Tunisia that were opposed by other Gulf Arab states.
Lingering tensions continue over Al Jazeera, one of the main international networks covering the unfolding events in Gaza. It rose to prominence following the September 11, 2001, terror attacks on the US and found fans and foes for addressing issues other networks wouldn't touch, including coverage that's critical of other Arab states.
Blinken asked Qatar to tone down Al Jazeera's rhetoric about the war, the Axios news website reported last week, over concerns the channel's framing of the conflict could escalate tensions in the region where it reaches tens of millions of viewers.
Yet despite the criticism of Qatar, not least for its connections with Hamas, there's still no alternative at the moment. That could change, according to Kristin Diwan, senior resident scholar at the Arab Gulf States Institute in Washington.
"No one else can play the role they have in negotiating and coordinating with Hamas in this critical moment," she said "Still, it's jarring to see Hamas officials call for expanding the war safely from Qatar's capital. Many of Qatar's neighbors would be content with Hamas' elimination from the political scene - and that particular card taken out of Qatar's hand."
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)