Israeli soldier Gilad Shalit will be released by Hamas in exchange for more than 1,000 Palestinian prisoners.

The deal, brokered by Israel's Prime Minister Benjamin Netanyahu and Hamas leadership, came as a surprise after five years of failed negotiations between the combative governments. Since Shalit's capture near the Gaza Strip in 2006, Hamas had demanded a large ransom for the IsraelI-French national. In 2009, Israel had to free 20 female Palestinian prisoners in exchange for a video tape of the detained soldier.

It is clear from the deal struck to release the captured Israeli soldier Gilad Shalit and more than 1,000 Palestinian prisoners being held in Israeli jails that most of these people could have been freed a lot earlier, the BBC's Middle East bureau chief Paul Danahar said Tuesday.

There is very little in this agreement that has not been on the table for years.

Nonetheless, Israeli's leadership has praised the treaty, and is excited about Shalit coming home.

I thank the Prime Minister [Benjamin Netanyahu] for the brave decision to return Gilad, Israeli President Shimon Peres said, according to Haaretz.

The prime minister made a bold decision that was correct, but not simple. I'm proud of the people of Israel, who can accept democratic decisions even in difficult moments and respect the principle of redeeming captives. I am aware of the feeling of pain of families who lost loved ones in terrorist attacks. At this time, we must warmly adopt them into our hearts.

Staff Sargent Gilad Shalit was captured in 2006, when he was just 20 years old, crossing through the Kerem Shalom kibbutz on the Gaza Strip-Israel border.

While the details of Tuesday's deal were not disclosed, Shalit could be released by Hamas as soon as November.

The exchange deal of Palestinian prisoners for Shalit [will be] implemented at the beginning of this November, with Egyptian mediation, Saudi Arabia's Al-Arabiya TV said, YNet reported.

“If all goes according to plan, Gilad will be returning to Israel in the coming days,” Netanyahu said Tuesday. When I took office I took it upon myself, as a personal mission, to bring Gilad home to his family.

Our main mission -- to actually bring Gilad home -- was extremely difficult and the negotiations were grueling. With everything that is happening in Egypt and the region, I don’t know if the future would have allowed us to get a better deal -- or any deal at all for that matter. This is a window of opportunity that might have been missed, the Prime Minster told his cabinet.

Meanwhile, 2,000 Palestinian prisoners in Israel are on a hunger strike to protest the solitary confinement of 20 of their countrymen. The prisoners joined 200 other detainees on Tuesday in the demonstration, and they are demanding better treatment behind bars, including access to university courses and Arab TV channels, according to YNet.

[Hamas] holds Israel fully responsible for the lives and safety of the prisoners... [it is] Israel’s abuses against those held in Israeli prisons that has inspired the hunger strike, the Palestinian group said in a statement last week.