The eyes of the world have been on Qatar, as mediators there announced a four-day truce between Israel and Hamas.
Its foreign affairs spokesperson Majed al Ansari revealed the details of the deal, including a temporary ceasefire and the release of some Israeli hostages in exchange for Palestinian prisoners.
Follow Israel-Gaza latest: British hostages to be released today
Along with their counterparts from the US and Egypt, the Qataris have been working since the early days of the current conflict to get an agreement between the two sides.
Here, Sky News looks at why the small Gulf state plays such a key role.
Please use Chrome browser for a more accessible video player
Friend to everybody – friend to no one
Since the 1990s and the takeover of Sheikh Hamad bin Khalifa Al Thani as leader, Qatar has positioned itself as a mediator in the Middle East.
“Qatar’s role as a mediator is not new,” Professor Mahjoob Zweiri, director of Qatar University’s Gulf Studies Centre, tells Sky News.
It is prepared to speak to non-state actors, tribal and militia groups that others – particularly Western countries – are not.
Over the years those groups have included the Afghan Taliban, Syrian rebels, Hamas, and other Palestinian militants such as Islamic Jihad.
Qatar also has a close relationship with Iran, with the two sharing natural gas fields worth billions.
Over the past few decades these relationships have allowed Qatar to facilitate deals between the likes of the US, Europe and Israel – and those groups – gaining some degree of leverage on both sides.
“The defining feature of Qatari foreign policy is pragmatic self-interest,” says Dr Melanie Garson, associate professor in international security and conflict resolution at University College London.
“It’s a friend to everybody – friend to no one approach.”
Relationship with Hamas
Like most Muslim-majority countries, Qatar has longstanding links to the Palestinian cause and supports a two-state solution.
In 2012 former Emir Sheikh Hamad became the first Arab leader to visit Gaza in years.
The Qataris give Hamas around £1bn a year and host its political bureau in Doha, with several exiled leaders based there.
Although it was the first Gulf state to establish relations with Israel in 1996, it severed ties again in 2009 following what Israel calls Operation Cast Lead and Palestinians refer to as the Gaza Massacre.
It was also not part of the 2020 Abraham Accords, which saw Arab states such as the UAE and Bahrain normalise relations with Israel.
Read more:
Israeli hostages transferred to Egypt
Israel and Hamas agree to pause fighting
Analysis: Biden has played key role in negotiations
“Of all of the Gulf states, Qatar is the least friendly towards Israel, as it sits outside the axis of the Abraham Accords,” Dr Garson says. “So it was possibly the only place Hamas could comfortably sit with that level of representation.”
While there are no formal diplomatic relations, there is an “arrangement” between Qatar and the Israelis, helped along by the US, Dr Zweiri says.
“You can’t have negotiations like the ones we’re seeing at the moment without Israel at the table,” Dr Garson adds. “So they’ve had to have that pragmatic approach to including them in the conversation.”
This has allowed Doha to mediate in both the current conflict and the one in 2014.
Strategic US relationship
The US and other Western states have benefited from Qatari help in negotiating deals with powers they view as malign.
During the Syrian civil war in 2017, it helped negotiate the release of hostages held in Iraq, some of whom included members of Qatar’s ruling family.
In 2019 it presided over talks that led to the release of two Western hostages taken by the Taliban in Afghanistan.
More recently it played a key role in evacuating thousands of people when the Taliban took power again in 2021 and this year it has been working on a prisoner swap between the US and Iran.
Qatar is also home to the largest US military base in the Middle East, which means the Americans “operate their own pragmatic self-interest” in the country, Dr Garson says.
What does the rest of the world think?
Dr Zweiri says Western states view Qatar as a “trustworthy player”, which understands both its international obligations and the politics of the region.
He adds that its main aims are a ceasefire in Gaza, avoiding the “radicalisation of a new generation” there, and overall regional stability.
Please use Chrome browser for a more accessible video player
But Dr Garson is more sceptical, and says: “Qatar has a clear funding channel to Hamas and Hamas has objectively perpetrated a horrific massacre.
“So it could be trying to reassert its influence on Hamas to try and deflect from – what could be viewed as – complicity in fuelling the war machine that led to this in the first place.
“The reality is this is not a negotiation that should have to happen. It should have been the unconditional release of hostages.
“So I think any experienced diplomat or foreign policy specialist can see this for what it is.
“These are odious negotiations, but in that position the West has to accept any agent able to assist.
“Israel has had to have that same pragmatism – that if this is the key to getting through this quicker, that stone can’t afford to be left unturned.”