Israeli PM Benjamin Netanyahu said they agreed only after arduous talks, and that Sergeant Gilad Shalit, 25, would be back with his family “within days”.
In exchange, Israel said will release hundreds of Palestinian prisoners.
Gilad Shalit was captured in a cross-border raid five years ago, and attempts to negotiate his release have failed.
Israeli PM said in a national TV address:
“We have concluded arduous negotiations with Hamas to release Gilad Shalit. He will be coming home in the next few days.”
Gilad Shalit’s continued detention is a hugely emotive issue in Israel, where his family has maintained a high profile campaign for his release.
According to a senior Israeli official, there are some high-profile Palestinian prisoners that have been excluded from the release deal.
The Israel and Hamas deal was confirmed in the Israeli cabinet by a 26-3 vote, following a heated three-hour debate.
“This is a difficult decision, but leadership is tested at moments like this, on the ability to make difficult decisions,” said PM Benjamin Netanyahu in a statement.
On the other hand, Hamas said in a statement that there were tens of thousands of people on the streets celebrating the deal, firing guns into the air and honking car horns.
Hamas’s leader Khaled Meshaal, who is in exile in Syria, appeared on TV to hail the swap deal as a victory for the Palestinian people.
Khaled Meshaal said the Israel had agreed to release 1,027 prisoners – including 27 women.
According to Yoram Cohen, head of Israel’s Shin Bet internal intelligence service, the high-profile prisoners not due for release include key Fatah leader Marwan Barghouti, Ahmed Saadat, found guilty of ordering the killing of Israel’s tourism minister in 2001, and Hamas’ Abdullah Barghouti.
“It is a great achievement, a qualitative success,” said the militant group’s leader, Khaled Meshaal.
“Because of this accord, there will no longer be any women in the jails of the enemy.”
Hamas leader promised to carry on working to free every Palestinian prisoner held in Israeli jails.
About 5,000 Palestinians are now held by Israel – some of whom have been convicted of serious crimes, but others are being held without charge.
Local Israeli television, Channel 2 TV reported that both sides, Israel and Hamas, had shown greater flexibility in recent talks.
Indirect talks over the Gilad Shalit ‘s release have been going on for years, with Egypt and Germany mediating.
In October 2009, Hamas released a video of Gilad Shalit calling on Benjamin Netanyahu to do everything to free him.
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…
Misleading allegations, rumours and outright lies about voting and fraud are flooding online spaces in…
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…