Gilad Shalit, the Israeli soldier who was seized in 2006 by Hamas, has been freed in a deal that involves the release of 1,027 Palestinians.

A gaunt-looking Shalit told Egyptian TV that he hoped the deal would promote peace between Israel and the Palestinians and also spoke of his desire to see freedom for thousands of others Palestinians still held by Israel.

Hamas members with black face masks and green headbands handed him over earlier today to Egyptian mediators before he was taken by helicopter to Tel Nof airbase in central Israel and re-united with his family.

More than 450 Palestinians were meanwhile transferred from Israeli prisons to the West Bank and Gaza, where massive celebratory rallies were held.

In Gaza City, tens of thousands crammed into an area where a huge stage was set up, decorated with a mural depicting Shalit's capture in a June 2006 raid on an army base near the Gaza border. The crowd exhorted militants to seize more soldiers for future swaps.

The rest of the prisoners – about 550 more – are to be released in a second phase in two months.

After a day that saw him embraced at Tel Nof airbase by the Israeli prime minister, Benjamin Netanyahu, Shalit touched down in his hometown of Mitzpe Hila on board a military helicopter.

Thousands of people jammed the streets and stood on rooftops, singing songs, waving Israeli flags and popping champagne bottles. A smiling Shalit briefly waved to the crowd before ducking into his family's house.

His father, Noam Shalit, told a news conference that his son had been kept in harsh conditions by his captors initially, but his treatment had got better over the years.

The prisoner swap was set in motion when Shalit was whisked across Gaza's border into Egypt early in the morning by armed Hamas militants in an SUV.

Wearing a black baseball hat and gray shirt, he was seen for the first time emerging from a pickup truck and turned over to Egyptian mediators by a gang of top Hamas militants, some with their faces covered in black masks with the green headband of Hamas' military wing.

Still escorted by Hamas gunmen, Shalit was then taken to a border crossing, where an Egyptian TV crew interviewed him before he was finally sent into Israel.

Stumbling over his words, he spoke in the interview of missing his family and friends, said he feared he would remain in captivity "many more years" and worried the deal might fall through after learning about it last week.

"Of course I missed my family. I missed friends, meeting people to talk to people, and not to sit all day, to do the same things," he said.

Israeli officials reacted angrily to the interview, saying it was inappropriate to force Shalit to answer questions in such difficult circumstances. But the interviewer, Shahira Amin, said he had not been coerced.

Hamas turned celebration in Gaza into a show of strength for the militant movement as thousands hoisted green Hamas flags and a smaller number raised the banners of rival movement Fatah.

At a rally in Gaza city attended by about 300 of the former prisoners, the Hamas prime minister, Ismail Haniyeh, praised those who captured Shalit and "started this historic moment for the Palestinian people".

"Our forces are always the winners," he said. "We will never be defeated, we will never be broken".

In the West Bank, Palestinian President Mahmoud Abbas addressed a crowd of several thousand, including released prisoners and their relatives.

Noam Shalit, the father of released Israeli soldier Gilad Shalit told a news conference that his son had been kept in harsh conditions by his captors initially, but his treatment had got better over the years