Jerusalem – Israel’s prime minister says a captured Israeli soldier held by Hamas militants will be home in the “coming days” after a prisoner exchange was agreed on.

Benjamin Netanyahu said late Tuesday that a deal with Hamas was initialed last Thursday and signed earlier Tuesday.

The deal would free hundreds of Palestinian prisoners, including many convicted in deadly attacks on Israelis, in exchange for Sgt. Gilad Schalit.

Netanyahu said in a televised address that he understands the pain of Israeli families who have lost loved ones to Palestinian violence. But he said he got “the best deal we could get” given the turmoil in the region.

More details shortly.

Israeli and Hamas have reached a deal to free a captured Israeli soldier held in the Gaza Strip in exchange for hundreds of Palestinian prisoners, officials from both sides said Tuesday, capping five years of painful negotiations that have repeatedly collapsed in fingerpointing and violence.

The deal would bring home Sgt. Gilad Schalit, who was captured in a cross-border raid in June 2006 by Palestinian militants who burrowed into Israel and dragged him into Gaza. Little has been known about his fate since then.

Israel’s prime minister, Benjamin Netanyahu, convened an urgent meeting Tuesday night with his Cabinet to approve the deal, said an Israeli official, who spoke on condition pending a formal announcement. Hamas officials and media outlets also confirmed the deal.

The agreement would exchange Schalit, 25, for around 1,000 Palestinian prisoners. Israel had previously balked at Hamas’ demands because some of the prisoners are serving lengthy sentences for deadly attacks on Israelis.

Other sticking points in the past have been whether prisoners would be allowed to return home to the West Bank and Gaza Strip, or be sent into exile instead. Exact details of the deal were not immediately available.

A Hamas delegation led by a top Hamas official, Mahmoud Zahar, arrived in Cairo Monday night from the group’s headquarters in Syria. The deal would be implemented within days, said Ezzat Rishq, a Hamas official in the delegation.

Schalit’s plight has captured the attention of Israel, where military service is mandatory for Jewish citizens, and people identify with the Schalit family’s pain.

Hamas has allowed no access to Schalit, and released only a brief audio recording and a videotaped statement early in his five years in captivity.

The soldier’s father, Noam, has become a well-known public figure through a a campaign to win his son’s freedom, leading demonstrations and sleeping in a tent outside Netanyahu’s residence.

Dozens of Israelis converged on the tent late Tuesday to offer support to the family. The tiny structure is decorated with pictures of Schalit, as well as a large sign with the number 1,934, the number of days he has been in captivity.

Schalit’s parents sat in the tent, smiling as people flooded to the area and cars honked horns in excitement.

Likewise, the plight of Palestinian prisoners is deeply emotional among Palestinians. Virtually every Palestinian has a relative who has served time in an Israeli prison, and Palestinians routinely hold large demonstrations where they hold up posters of their imprisoned loved ones.

Announcement of the deal coincided with a hunger strike launched by hundreds of Palestinian prisoners seeking better conditions. The prisoners had been demanding the restoration of key privileges, such as having Arabic TV channels and being allowed to take university course, which have been systematically stripped since Schalit’s captured.

It was unknown whether the leader of the hunger strike, Ahmed Saadat, or the most prominent prisoner, Marwan Barghouti, would be included in the deal.

Saadat was convicted of planning the assassination of an Israeli Cabinet minister in 2001. Barghouti was the top local commander of Fatah, the movement of President Mahmoud Abbas, when he was arrested in 2002 and convicted of a role in deadly attacks against Israelis. He is serving multiple life terms.

Neither Saadat nor Barghouti belongs to Hamas, but Hamas is eager to portray itself as representing all Palestinians. The Islamic militant group is in a bitter rivalry with Palestinian President Mahmoud Abbas, who is enjoying a burst of popularity after defying Israel and the U.S. and seeking membership for the Palestinians at the U.N.

Salah Bardawil, a top Hamas official in Gaza, said the revolution in neighboring Egypt had also helped fuel a deal. He said the new regime “undertook tireless efforts” to broker an agreement.

“Israel began to feel trust in the Egyptian side … and we put all our trust in the new Egyptian leadership as a trusted mediator,” he said. “The changes in the region have forced the timing on all of us.”

The Palestinians have been divided between rival governments, Abbas’ Palestinian Authority in the West Bank and Hamas’ regime in Gaza, since Hamas overran the coastal strip in 2007.

The exchange would include Amina Mona, a young woman who lured a lovestruck Israeli teenage boy to a Palestinian city over the Internet, only to have him killed by waiting militants, according to Mohammed al-Barem, a leader of the Popular Resistance Committees, one of the groups that captured Schalit. He gave no other names, but said it included 300 prisoners serving life sentences.

Israeli groups representing the families of people killed by Palestinian militants have objected to a prisoner swap, saying it would be too painful to allow their children’s murderers to go free.

Netanyahu is eager for a domestic boost. The Israeli leader has faced growing criticism for a deadlock in peace efforts with the Palestinians, as well as a series of domestic protests over the country’s steep cost of living. Bringing Schalit home is sure to make Netanyahu a hero.

German and Egyptian mediators tried to broker deals between Israel and Hamas over the past five years. Those talks have repeatedly broke down, and Israel has carried out a number of military strikes and also imposed a blockade on the Gaza Strip, partly to pressure Hamas over the case of the soldier.