Jeremy BowenInternational Editor
BBC
Even for Donald Trump, a president who revels in his place at the centre of world events, it was a dramatic moment.
The US Secretary of State Marco Rubio interrupted a televised meeting Trump was chairing in Washington DC on Wednesday. He handed over a message that the President needed to tell the world that they had a deal. Trump told the audience in the room – and millions more who have now seen the video – that he would have to leave.
"They're going to need me…" he said, interrupting the day's business. "I have to go now to try to solve some problems in the Middle East."
Israel and Hamas signed off the first phase of what Donald Trump intends to be a wider agreement after three days of indirect talks in Egypt.
EPA/SHUTTERSTOCK
'I have to go now to try to solve some problems in the Middle East,' Trump announced after Rubio whispered to him
Mediators from Qatar and Egypt went between the Israeli and Palestinian negotiators who were on separate floors of a hotel in the Red Sea resort of Sharm El-Sheikh.
To add heft to the talks, and to keep the pressure on the Israelis, Donald Trump sent his son-in-law Jared Kushner and his envoy Steve Witkoff.
The prime minister of Qatar and the intelligence chiefs of Egypt and Turkey were there to do the same job for the Hamas delegation.
The agreement is a major breakthrough. It does not mean the war is over. But for the first time since the Hamas attacks on Israel, there is a realistic chance of ending the horrors of the last two years.
One big step - but more steps are needed
The plan is that a ceasefire will be followed by the release of the remaining Israeli hostages, in return for Palestinian prisoners and detainees.
The Israeli military, the IDF, will pull back from its current positions, leaving it in 53% of Gaza according to the government spokesperson.
Israel will lift enough of its restrictions on humanitarian aid entering Gaza to allow in 400 lorry loads a day, which would be distributed by the UN and other agencies.
The controversial Gaza Humanitarian Foundation, the discredited system which Israel wanted to replace the UN, is not mentioned in Donald Trump's 20-point plan.
The deal is a big step, but more need to be taken to get to the war's end. Trump's plan is a framework, with the details left to be negotiated. Serious obstacles lie ahead.
Reuters
The plan is that a ceasefire will be followed by the release of the remaining Israeli hostages, in return for Palestinian prisoners and detainees
Hamas wants Israel out of the Gaza Strip. Israel's prime minister Benjamin Netanyahu says that will not happen. Hamas is prepared to give up heavy weapons but wants to keep some armaments. Netanyahu wants the complete demilitarisation of Gaza.
He has defined victory for Israel as more than simply the return of the hostages. He has said many times that Hamas must be destroyed, with no chance of regenerating itself in Gaza as a danger to Israelis.
How the Biden plan measured up
In May 2024 President Joe Biden put a deal on the table that resembles Trump's plan. Then, Hamas agreed that it would release Israeli hostages if the IDF pulled out of the Gaza Strip and there were guarantees that Israel would not restart the war. Netanyahu was not prepared to agree.
Over the past two years he has said repeatedly that continuing the war was the only way to get the hostages back and to destroy Hamas.
Reuters
Biden never threatened to end US diplomatic, financial and military support to Israel, with only one exception
Perhaps the Biden plan was too early for both sides. The difference between what has happened now and what didn't happen in May of last year is that Trump has used the leverage America has over Israel to bring Netanyahu to the table.
Despite expressing concern about Israel's conduct of the war, Biden never threatened to end US diplomatic, financial and military support, with the exception of one consignment of 2,000 pound bombs. Israel could not have fought the war with US help. Biden was not prepared to exploit that dependence. Netanyahu was confident he could defy him.
Trump has kept up the military and political support, but he wants much more in return.
Knock-on effect of the Doha attack
A crucial event that led to a breakthrough was Israel's failed attempt to kill the Hamas leadership in Doha on 9 September.
Its main target, the senior leader Khalil al-Hayya and his top lieutenants were discussing the latest version of Trump's peace plan when the attack happened.
They survived but his son was among the dead. Al Hayya is leading the Hamas delegation in Egypt.
The Israelis did not tell the Americans in advance that they were going to hit Doha. Trump was furious.
Anadolu via Getty Images
An Israeli strike targeted Hamas leadership in Doha
When Netanyahu asked to meet him in the Oval Office at the White House, he forced him to ring the Qatari prime minister to make a fulsome apology.
As Netanyahu read out the apology he had prepared, the cable from the handset was at full stretch back to a scowling Donald Trump who held the phone in his lap.
The White House released photos that looked like a headmaster making an errant pupil say sorry.
Trump also issued an executive order giving unprecedented security guarantees to Qatar if it is attacked again. He needed that apology because Qatar is an American ally, hosting the biggest US military base in the Middle East, and is a key part of the wider plan he has for peace in the region.
At its heart is a grand bargain based on Saudi Arabia normalising relations with Israel.
Instead, the Israeli raid made the Americans look like an ally that cannot protect their friends.
Getty Images
Trump says that the deal could be the biggest thing in the Middle East for 3,000 years - hyperbole on a grand scale
Other things have changed: the IDF has killed many more Palestinians and destroyed much more of Gaza. Israel is as isolated as at any time since it became independent in 1948. Netanyahu's appearance at the speaker's podium at the UN General Assembly in New York in September sparked a mass walkout of diplomats.
America remains a powerful ally, but the polls in the US show that the Israelis cannot rely any more on the support of a majority of Americans. That reduces the political jeopardy of overruling the objections of Israel's prime minister.
Israel's European allies, led by the UK and France, have recognised an independent state of Palestine. Their public statements have expressed horror over the killing and destruction in Gaza, and the starvation and in places famine caused by Israel's blockades of aid.
The 9 September attack on Doha also created a new sense of urgency among Arab and Muslim majority countries. A rare united front pressed Donald Trump to get Israel to the table.
If the Trump 20-point plan is to end the war US, pressure on Israel will have to continue.
Getty Images
Could Benjamin Netanyahu find a way to resume the war after the hostages return home?
One major question is whether Benjamin Netanyahu will find a way to resume the war after the hostages come home. His ultra-nationalist allies in the cabinet want that to happen.
The rich gulf states - that Trump admires and wants to play a big role in a relaunch and redevelopment of Gaza - will keep the pressure on the US president to try to make sure that does not happen.
Bittersweet celebrations on both sides
The breakthrough in Sharm El-Sheikh was greeted by celebrations in Israel and inside the Gaza Strip, bittersweet on both sides after so much loss.
In Israel the families of hostages and their supporters have been waging a constant campaign of pressure and demonstrations to get their people out of Gaza.
Opinion polls have shown consistently that a majority of Israelis are prepared to end the Gaza war if the hostages, living and dead, come home.
It is thought 20 hostages may be alive. Hamas has also agreed to return the bodies of around 28 others, though it is not certain that all their graves can be located.
Palestinians celebrated in the ruins of Gaza. In return for the hostages Israel has agreed to free 250 prisoners serving life sentences and 1,700 detainees who have been taken by the IDF from Gaza in the last two years.
Palestinians will welcome them as heroes.
EPA/SHUTTERSTOCK
There were celebrations among Palestinians (pictured) and Israelis - bittersweet on both sides after so much loss
Israel has ruled out freeing Marwan Barghouti, who was arrested in 2002 and later given five life sentences plus 40 years for orchestrating attacks on Israelis. Many Palestinians see him as their Nelson Mandela, who served 27 years in prison for planning attacks on the apartheid regime in South Africa before he was released to win a democratic election.
Hamas wants freedom for some of their most prominent commanders who Israelis regard as dangerous terrorists. Releasing them will be controversial.
Yahya Sinwar, who led the 7 October attacks before he was killed by Israel, was freed in a prisoner exchange in 2011. The Hamas list is believed to include, among others, Abbas al Sayyed who is serving 35 life sentences plus 100 years for attacks, including one in 2002 that killed 35 Israelis celebrating Passover.
Another name mentioned is Hassam Salama who was given 46 life sentences for sending suicide bombers to blow up buses in Jerusalem in 1996, killing and wounding dozens of Israelis.
Reuters
Opinion polls have shown that most Israelis are prepared to end the war if the hostages return home
Donald Trump says that the deal could be the biggest thing in the Middle East for 3,000 years. That is Trumpian hyperbole on a grand scale.
But if the exchange of Israeli hostages for jailed Palestinians is followed by progress on the other points that need agreement in the Trump plan, there is a real chance that some of the agony on both sides will end.
Despite the risks ahead in a hugely challenging negotiation, optimists are already hoping that an end of the war in Gaza might kickstart a new era in the Middle East. That would take a level of application and consistency that Trump has not yet displayed.
A short sharp negotiation in Egypt suits his brash, bullying style. Finding a way to end the conflict that is well into its second century between Israelis and Palestinians for control of the land between the river Jordan and the Mediterranean would require a wholly different set of skills.
BBC InDepth is the home on the website and app for the best analysis, with fresh perspectives that challenge assumptions and deep reporting on the biggest issues of the day. And we showcase thought-provoking content from across BBC Sounds and iPlayer too. You can now sign up for notifications that will alert you whenever an InDepth story is published - click here to find out how.