Israeli soldier Gilad Shalit was released to a national outpouring of joy Tuesday after five years in captivity, exchanged for hundreds of Palestinian prisoners in a deal with Gaza's Hamas rulers.

Shalit, 25, was taken across the frontier from the Gaza Strip into Egypt's Sinai peninsula and driven to Israel's Vineyard of Peace border crossing, where a helicopter awaited to fly him to an Israeli air base for a reunion with his parents.

Simultaneously, Israel started freeing 477 Palestinian prisoners, with witnesses seeing the first batch arriving in Gaza with others due to be released in the occupied West Bank.

A further 550 jailed Palestinians are to be handed over later this year, and some 40 are being sent into exile to Turkey, Qatar and Syria.

In the first video of Shalit released since 2009, Egyptian television footage showed the soldier, dressed in civilian clothes and wearing a baseball cap, during the exchange.

Unsmiling and looking dazed, Shalit walked briskly, with Hamas officials flanking him and gripping his arms as they led him away from a vehicle. Israeli television stations played the brief video repeatedly in a loop for 20 minutes.

The deal, between two bitter enemies, seemed unlikely to have any immediate impact on efforts to revive Israeli-Palestinian peace talks, which broke down last year.

The mood in Israel was one of elation, with welcome home signs on street corners and morning commuters watching live broadcasts of the swap on cellular telephones.

Shalit has been popularly portrayed as everyone's son and opinion polls showed that an overwhelming majority of Israeli backed the thousand-for-one deal, although many of the prisoners going free were convicted of deadly attacks.

For Palestinians, it was a time to celebrate what Hamas hailed as a victory, and a heroes' welcome awaited the released prisoners. Palestinians see brethren jailed by Israel as prisoners of war in a struggle for statehood.

This is the greatest joy for the Palestinian people, said Azzia al-Qawasmeh, who waited at a West Bank checkpoint for her son Amer, whom she said had been in prison for 24 years.

The deal received a green light from Israel's Supreme Court late on Monday after it rejected petitions from the public to prevent the mass release of prisoners, many serving life sentences for deadly attacks.

CROSS-BORDER RAID

Shalit was abducted in June 2006 by militants who tunnelled into Israel from the Gaza Strip and surprised his tank crew, killing two of his comrades. He was whisked back into Gaza and has since been held incommunicado.

Israel, which withdrew troops and settlers from Gaza in 2005, tightened its blockade of the small coastal enclave after Shalit's disappearance.

The deal with Hamas, a group classified by the United States and European Union as a terrorist organization over its refusal to recognize Israel and renounce violence, is not expected to spur peace negotiations.

Those talks, led by Israel and Palestinian President Mahmoud Abbas, a Hamas rival, collapsed 13 months ago in a dispute over settlement building in the occupied West Bank. Abbas now wants the U.N. to recognize Palestinian statehood, a unilateral bid opposed by Israel and its main ally, the United States.

At Tel Nof air base in central Israel, Shalit will see his parents, whose public campaign for his release put pressure on Prime Minister Benjamin Netanyahu to make a deal with a bitter enemy. Netanyahu will also meet Shalit there. Later, Shalit will fly by helicopter to his family home in northern Israel.

The repatriation of captured soldiers, alive or dead, has long been an emotionally charged issue for Israelis. Many have served in the military as conscripts and see it as sacrosanct. But they also feel stung by the high price they feel Israel is paying for Shalit.

I understand the difficulty in accepting that the vile people who committed the heinous crimes against your loved ones will not pay the full price they deserve, Netanyahu wrote in a letter, released by his office, to bereaved Israeli families.

(Additional reporting by Rami Amichai, Ronen Zvulun, Ari Rabinovitch, Maayan Lubell, Douglas Hamilton, Mohammed Salem and Tom Perry; Writing by Jeffrey Heller, editing by Crispian Balmer)