Israel and Hamas have signed off on the first phase of a peace plan for Gaza, US President Donald Trump announced on Wednesday evening.
The plan states all hostages will be released and Israel will withdraw troops to an agreed-upon line.
It marks an extraordinary moment two years and one day after Hamas militants attacked Israel, starting a brutal war that has devastated Gaza, dominated global politics and unleashed seismic shifts across the Middle East.
Mr Trump hailed a "great day" for the Arab and Muslim world, Israel and its neighbours and the US. He also thanked mediators Qatar, Egypt and Turkey.
"Blessed are the peacemakers!" he wrote in a message on social media, adding that all remaining hostages would be released "very soon". He later told Fox News the releases would happen on Monday.
“All parties will be treated fairly," he wrote.
Israeli Prime Minister Benjamin Netanyahu said in a brief statement: "With God’s help, we will bring them all home," referring to the hostages.
Hamas called on Mr Trump, “the guarantor states, and all Arab, Islamic and international parties” to ensure the ceasefire with Israel in Gaza is fully implemented.
In a statement, Hamas asked that Israel be prevented “from evading or delaying the implementation of what has been agreed”.
The Hamas attack on Israel on October 7, 2023, killed 1,200 people and saw Palestinian militants kidnap about 240 hostages.
Since then almost 67,200 Palestinians have been killed in the coastal enclave and nearly 170,000 injured, according to local health officials, and most of the territory has been laid to waste. Most hospitals have been destroyed and an Israeli blockade has compounded suffering, with severe malnutrition now common.
Mr Trump's announcement came hours after he said he would probably travel to Egypt, and possibly Gaza, at the weekend.
Sources told The National that he is planning to attend the signing of the deal reached in negotiations that began in the Egyptian resort town of Sharm El Sheikh on Monday.
The deal will provide for the release of the 48 hostages held by Hamas, of whom only 20 are believed to be alive, in exchange for the freedom of hundreds of Palestinians in Israeli prisons.
The first batch of hostages will include all of the living and an unspecified number of bodies of those who have died. Hamas will then locate and exhume the remains of the rest who have been buried in tunnels that have been destroyed in Israeli strikes, said the sources.
The release of the hostages and prisoners will commence when a ceasefire is declared, they added.
The sources in Cairo said Israel has agreed that the hundreds of Palestinians to be freed will include such prominent figures such as Marwan Bargouti, who is widely tipped as a successor to Palestinian Authority President Mahmoud Abbas, and Ahmad Saadat. Both are senior leaders of the mainstream Fatah faction.
They also include Ibrahim Hamed, one of the founders of Hamas's military wing, Ezzedine Al Qassam Brigades. The Palestinians to be freed will also include about 60 who had been rearrested by Israel after their release from prison in 2011 as part of an Egyptian-brokered deal to free Israeli soldier Gilad Shalit. The soldier spent more than five years held hostage by Hamas and was released in exchange for more than 1,000 Palestinians incarcerated in Israel.
“Peace for the Middle East – it's a beautiful phrase,” Mr Trump said earlier. “And we hope it's going to come true."
US Middle East envoy Steve Witkoff and Mr Trump's son-in-law Jared Kushner were in Egypt on Wednesday, joining the negotiations to end the two-year-old war.
The announcement comes after Egypt's President Abdel Fattah El Sisi invited Mr Trump to a signing ceremony if Israel and Hamas were to reach an agreement.
On Tuesday, Mr Trump said the US would do everything possible to ensure that all sides adhere to a ceasefire deal in Gaza.
The momentum is the result of his 20-point plan for Gaza, which he revealed last week from the White House alongside Israeli Prime Minister Benjamin Netanyahu.
The plan aims to end the war in Gaza, rebuild it and put in place new leadership. It also calls for Hamas to disarm, and the gradual withdrawal of Israeli forces from Gaza.
Much of the coastal enclave has been reduced to rubble, and the true scale of the devastation, including casualties, remains unknown.