U.S. President Donald Trump hailed a "tremendous day for the Middle East" as he and regional leaders signed a declaration Monday meant to cement a ceasefire in Gaza, hours after Israel and Hamas exchanged hostages and prisoners.

Trump made a lightning visit to Israel, where he lauded Prime Minister Benjamin Netanyahu in an address to parliament, before flying to Egypt for a Gaza summit where he and the leaders of Egypt, Qatar and Turkey signed the declaration as guarantors to the Gaza deal.

"This is a tremendous day for the world, it's a tremendous day for the Middle East," Trump said as more than two dozen world leaders sat down to talk in the resort of Sharm el-Sheikh.

He later declared that the assembled leaders had "achieved what everybody said was impossible."

"At long last, we have peace in the Middle East," Trump said in a speech.

According to the document, the signatories pledged to "pursue a comprehensive vision of peace, security and shared prosperity in the region," and also welcomed "the progress achieved in establishing comprehensive and durable peace arrangements in the Gaza Strip."

Egyptian President Abdel-Fattah el-Sissi said the Gaza deal "closes a painful chapter in human history" and sets the stage for a two-state solution.

U.S. President Donald Trump addresses the Israeli parliament in Jerusalem on Monday.
U.S. President Donald Trump addresses the Israeli parliament in Jerusalem on Monday. | Pool / via AFP-Jiji

As part of Trump's plan to end the Gaza war, Hamas on Monday freed the last 20 surviving hostages it held after two years of captivity in Gaza.

In exchange, Israel released 1,968 mostly Palestinian prisoners held in its jails, its prison service said.

"For so many families across this land, it has been years since you've known a single day of true peace," Trump said earlier in the day during his address to Israel's parliament, where he received a lengthy standing ovation.

"Not only for Israelis, but also for Palestinians and for many others, the long and painful nightmare is finally over."

In Tel Aviv, a huge crowd that had gathered to support hostage families erupted in joy, tears and song as news broke of the first releases, though the pain at the loss of those who had not survived was palpable.

In the occupied West Bank city of Ramallah, huge crowds gathered to welcome home the first prisoners, with some chanting "Allahu akbar," or God is the greatest, in celebration.

And in the southern Gaza city of Khan Yunis, residents climbed the sides of the slow-moving Red Cross buses carrying the prisoners to greet their loved ones with a hug or kiss.

"Welcome home," Israel's foreign ministry said on X, hailing the return of the hostages.

None of the captives spoke directly to AFP immediately after their return, but videos filmed and released by the Israeli military captured some of the raw emotion of the reunions.

"My life, you are my life ... you are a hero," cried Einav Zangauker as she embraced her smiling son Matan, in one video.

Under the ceasefire agreement, Hamas is also due to return the bodies of 27 hostages who died or were killed in captivity, as well as the remains of a soldier killed in 2014 during a previous Gaza conflict.

Israel has said it does not expect all of the dead hostages to be returned on Monday, though the army said the bodies of four captives had been handed over to the Red Cross by Hamas and brought to Israel.

Of the prisoners Israel freed in return, around 250 were security detainees, including many convicted of killing Israelis, while about 1,700 were taken into custody by the army in Gaza during the war.

Palestinian prisoners released by Israel wave from a bus as they arrive at Nasser Hospital in Khan Younis, in southern Gaza, on Monday.
Palestinian prisoners released by Israel wave from a bus as they arrive at Nasser Hospital in Khan Younis, in southern Gaza, on Monday. | Saher Alghorra / The New York Times

On Oct. 7, 2023, Hamas-led militants seized 251 hostages during their unprecedented attack on Israel, which led to the deaths of 1,219 people, most of them civilians.

All but 47 of those hostages were freed in earlier truces, with the families of those who have remained in captivity leading lives of constant pain and worry for their loved ones.

In Gaza, too, the ceasefire has brought relief, but with much of the territory flattened by war, the road to recovery remains long.

Israel's campaign in Gaza has killed at least 67,869 people, according to figures from the health ministry in the Hamas-run territory that the United Nations considers credible.

"The greatest joy is seeing my whole family gathered to welcome me," said Yusef Afana, a 25-year-old released prisoner from north Gaza.

"I spent 10 months in prison — some of the hardest days I've ever lived."

In Ramallah, Palestinian prisoners released by Israel were met by a cheering crowd so dense that they struggled to get off the bus that delivered them from jail.

"It's an indescribable feeling, a new birth," newly released Mahdi Ramadan said, flanked by his parents.

Trump's visit to the Middle East aims to celebrate his role in brokering last week's ceasefire and hostage release deal — but much remains to be negotiated.

Among the potential sticking points are Hamas's refusal to disarm and Israel's failure to pledge full withdrawal from the devastated territory.

The U.S. leader, however, repeatedly signaled he was confident the ceasefire will hold, saying at a joint appearance with Sisi in Sharm el-Sheikh that talks on the next steps of the plan had already "started, as far as we're concerned."

Trump announced in late September a 20-point plan for Gaza, which helped bring about the ceasefire.

He briefly met Palestinian president Mahmud Abbas at the summit, which representatives of Israel and Hamas did not attend, and departed in the evening.

Hamas spokesman Hazem Qassem on Monday urged Trump and the mediators of the Gaza deal to "continue monitoring Israel's conduct and to ensure it does not resume its aggression against our people".