US President Donald Trump has said that Israel and Hamas have agreed on the first phase of his Gaza peace plan, hailing it as a "historic and unprecedented" step to ending the two-year-old war.
Hamas would release all hostages while Israel would pull its troops back to an agreed upon line, Mr Trump said after talks in Egypt on his 20-point peace plan resulted in a deal.
"I am very proud to announce that Israel and Hamas have both signed off on the first Phase of our Peace Plan," Mr Trump said on his Truth Social network.
"This means that ALL of the Hostages will be released very soon, and Israel will withdraw their Troops to an agreed upon line as the first steps toward a Strong, Durable, and Everlasting Peace."
Mr Trump also thanked mediators Qatar, Egypt and Turkey, adding: "BLESSED ARE THE PEACEMAKERS!"
Hamas has said that it had reached an agreement to end the war in Gaza following the talks, saying the deal includes an Israeli withdrawal from the enclave and a hostage-prisoner exchange.
Hamas has called on Mr Trump and guarantor states to ensure Israel fully implements the ceasefire, it added in a statement.
Israeli Prime Minister Benjamin Netanyahu said he would bring the hostages home "with God's help".
He said that he would convene the government to approve the ceasefire agreement.
Mr Trump said earlier that he may travel to the Middle East later this week as a deal was "very close".
In a dramatic moment, AFP journalists saw US Secretary of State Marco Rubio interrupt an event at the White House and hand Mr Trump an urgent note about the progress of the negotiations in Egypt.

"I may go there sometime toward the end of the week, maybe on Sunday," Mr Trump said, adding that he was "most likely" to turn up in Egypt but would also consider going to war-torn Gaza.
Mr Trump's plan called for a ceasefire, the release of all the hostages held in Gaza, Hamas's disarmament and a gradual Israeli withdrawal from the territory.
Mr Trump's son-in-law Jared Kushner and Middle East envoy Steve Witkoff arrived at the talks earlier.
As night fell in the coastal area of Al-Mawasi in southern Gaza, an AFP contributor described an atmosphere of anticipation before the announcement.
"We're closely following every bit of news about the negotiations and the ceasefire," said one man who had been displaced from northern Gaza.
Hamas had submitted a list of Palestinian prisoners it wants released from Israeli jails in the first phase of the truce.
In exchange, Hamas is set to free the remaining 47 hostages, both alive and dead, who were seized in its 7 October 2023 attack on Israel which sparked the war.
Qatar's prime minister and Turkey's intelligence chief were also expected at the talks.
Hamas said it would be joined by delegations from Islamic Jihad - which has also held some of the hostages in Gaza - as well as the Popular Front for the Liberation of Palestine.


The negotiations were taking place under the shadow of the second anniversary of the 2023 Hamas attack on Israel, which resulted in the deaths of 1,219 people, mostly civilians, according to an AFP tally based on official Israeli figures.
Militants also took 251 people hostage into Gaza, where 47 remain, including 25 the Israeli military says are dead.
Israel's military campaign in Gaza has killed at least 67,183 people, according to the health ministry in the Hamas-run territory, figures the United Nations considers credible.
The data does not distinguish between civilians and combatants but indicates that more than half of the dead are women and children.
The territory's civil defence agency, a rescue force operating under Hamas's authority, said the bombardment of Gaza had not stopped in the hours before the deal.
Global pressure to end the war has escalated, with much of Gaza flattened, a UN-declared famine unfolding and Israeli hostage families still longing for their loved ones' return.