|Shalit, 25, has become a national issue in Israel where military service is mandatory [AFP]
Khaled Meshaal, the leader of Hamas, has said that more than 1,000 Palestinian prisoners in Israeli prisons will be released in exchange for the captured Israeli soldier Gilad Shalit.
Hamas reached a deal with Israel on Tuesday for the release 1,027 prisoners in exchange for Shalit, who was captured in 2006 and has since been held in the Gaza Strip, Meshaal said in a televised address.
"This is a national achievement that we should be proud of," said Meshaal who was speaking from Damascus, the Syrian capital.
The Israeli Cabinet approved the prisoner swap after a stormy late-night meeting, with 26 ministers voting in favour and three opposing it.
In Gaza, thousands poured out onto the streets in Jabaliya where celebratory gunfire and car horns could be heard all around, Al Jazeera's Nicole Johnston said.
"It's really important to remember that the first part of the siege on Gaza really started after the capture of Gilad Shalit and intensified after Hamas won the elections and took power in Gaza," Johnston said.
"The people in Gaza have had very much to bear the brunt of the capture of Shalit with a five-year-long siege, which means they haven't been let out of Gaza, exports and imports have been severely restricted, and for some time hardly anything was allowed in."
Meshaal said the detainees, among them 27 women, will be freed in two phases: the first phase will see the release of 450 "in one week" and in the second phase another 550 will be freed "in two months".
The list of 1,027 includes 315 prisoners who have been sentenced to life, the result of negotiators giving "priority to those who have spent over 20 years" in jail, he said.
"We were very keen for this deal to include prisoners from across different categories, from different age groups and from the West Bank and Gaza, from Jerusalem and the Golan [Heights]."
He also stressed that the deal reflected the unity of the Palestinian people, and vowed to fight until "the day all Palestinians imprisoned in Israel are freed.
Two high-profile prisoners -- Marwan Barghouti, the influential Fatah leader, and Ahmed Sa'adat, head of the Popular Front for the Liberation of Palestine -- will not be released as part of the swap deal, Yoram Cohen, the head of Israel's Shin Bet intelligence service, said.
Meshaal's address came soon after that of Binyamin Netanyahu, the Israeli prime minister, in which he said "Our son will be home in the coming days," in reference to Shalit.
Negotiations were initiated in Cairo on Thursday under the mediation of Egyptian security and intelligence officials, and an agreement was signed earlier on Tuesday, Netanyahu said.
Later in a tweet, Netanyahu thanked "the Egyptian government and its security forces for their role in mediation and concluding the deal".
Meshaal, the Hamas chief, also thanked Egypt, as well as Qatar, Turkey, Syria and Germany which he said had all been involved in the negotiations.
Egypt is lapping up all the credit and praise, at a time where the interim ruling military council has been facing much criticism from its public, Al Jazeera's Sherine Tadros reported from Cairo.
Israel had made previous attempts to free Shalit through a prisoner swap with Hamas, but talks became bogged down over disagreements about who Israel might free, with both sides blaming one another.
"In previous times when we felt very close to a Shalit deal - especially a year ago when I was in fact in Gaza - the major sticking point was that the Palestinians felt it was the Egyptians who had faltered on what they offered Israelis," our correspondent said.
"But the Arab Spring in Egypt has changed dynamics to a point where both the sides felt they could deal with the Egyptians."
The authorities in Cairo knew how important it was for them to have this kind of trust, and they could expect to make a lot of political capital out of the deal, she added.
Reporting from Jerusalem, Al Jazeera's Cal Perry said both Meshaal and Netanyahu had said "oddly similar things".
"They both said that this deal was a unifying moment, both claiming a victory in their own right."
The swap deal comes at a pragmatic time for Netanyahu, who is struggling with his country's deteriorating relations with Cairo, our correspondent said.
Secondly, as prime minister of a country where military service is mandatory, Netanyahu had been under immense pressure from the Shalit family to secure his release, he added.
"Every Israeli rallies around the armed forces here and nationally it's a huge issue - Shalit, the man himself, has become the issue."
Shalit's mother said she was overcome with joy. "The joy cannot even be described," she told reporters in her Jerusalem protest tent.
However, she said, she would constrain her emotions until she sees her son.
"We are waiting with great worry for the week or 10 days until Gilad comes back."
Noam Shalit, the soldier's father, said: "This is a symbolic day, in which the government of Israel, after more than five years, 1,935 difficult days and 1,935 long nights, is to bring Gilad home."