The swap set off massive celebrations in Israel and the Palestinian territories, where crowds in Gaza called for more kidnappings of soldiers, chanting: "The people want a new Gilad!"
The 25-year-old Schalit's poor condition, a jarring appearance by masked Hamas men during his release and the prospects of a strengthened Hamas bode poorly for future relations between Israel and the Palestinians.
By winning the release of hundreds of militants accused in notorious suicide bombings of the Palestinian uprising a decade ago, Hamas reinforced its message that Palestinian goals are advanced most effectively through violent struggle, and not the moderate approach of diplomacy favored by Palestinian President Mahmoud Abbas.
"Israel was forced to pay the price," Hamas' supreme leader, Khaled Mashaal, boasted in a meeting in Egypt, where he greeted 40 freed prisoners who were immediately sent into exile under the terms of their release.
To Israelis, the return of a young man whose plight had become a national obsession brought a welcome lift. But for many, especially the family of victims who had lost relatives in Palestinian violence, it carried a bitter taste of justice denied.
After being hidden from public view since his capture five and half years ago, Schalit - the first captive Israeli soldier to return home alive in a generation - was whisked early Tuesday across Gaza's border by a group of armed Hamas militants.
A brief video released by Egyptian TV showed the young sergeant wearing a baseball cap and gray shirt, surrounded by Gaza militants with black face masks and green headbands who then handed him over to Egyptian mediators.
Before he was turned over to Israeli officials, Schalit spoke to Egyptian TV in an interview while masked militants milled around and Hamas' No. 2 leader, Musa Abu Marzouk, hovered nearby.
Israeli officials called the interview "shocking."
Looking wan and uncomfortable, Schalit appeared to struggle to speak at times, and his breathing was noticeably labored as he answered questions asked through an interpreter.
Stumbling over his words, he spoke in Hebrew of missing his family and friends, said he feared he would remain in captivity "many more years" and worried that the deal might fall through after learning about it last week.
At times, the questions seemed awkward and even inappropriate. Noting that more than 4,000 Palestinians are still imprisoned in Israel, the interviewer asked: "Will you help campaign for their release?"
After a long pause, Shalit replied: "I would be really happy that (Palestinian prisoners) are freed, but they shouldn't go back to fighting Israel." Then he added: "I really hope that this deal advances peace and not more military conflicts and wars between Israel and the Palestinians."
Later, video released by the Israeli military showed Schalit being helped into a military vehicle for the crossing into Israel, then limping as he left a building after changing into a fresh army uniform with the newly promoted rank of sergeant first class.
Military officials said a physical exam had found him to be in "good" condition, though he showed signs of malnutrition; his father later said his son was suffering from shrapnel wounds apparently sustained during his capture as well as psychological scars.
In Schalit's hometown, the tiny village of Mitzpe Hila in northern Israel, thousands of people filled streets and rooftops to welcome him home, waving flags, uncorking champagne, singing and dancing.
"This is so exciting it warms the heart. No one could imagine such a happy ending," said Atalia Rosenfeld, a well-wisher. "It reinforces my faith in this country."
Schalit was captured by Hamas-linked militants in a cross-border raid in June 2006, then dragged to the Gaza Strip. He was kept in isolation, barred from having visitors and seen only once, in a scripted video released by his captors two years ago to prove he was alive.
Israeli pressure, including an economic blockade and a fierce military offensive in the weeks after his capture, failed to win his release.
Under Tuesday's agreement, Israel exchanged 477 prisoners - most of them serving life sentences for involvement in deadly attacks on Israelis. A second batch of 550 prisoners is to be released in two months.
In Mitzpe Hila, Schalit, who arrived on board a military helicopter, smiled and waved briefly to the crowd before ducking into his family's house.
Addressing the crowd, Schalit's father, Noam, thanked the Israeli public for years of support and said his son was healthy overall, but would need to recover from psychological and physical wounds.
"Naturally he can't be exposed to so many people because he was in isolation so many days and years and couldn't interact with people in his language, and all he could do was communicate with his abductors and guards," he said.
He said his son hadn't said much about his captivity, only that his treatment was poor at the beginning but improved in recent years, including sporadic access to radio and television.
The elder Schalit has become a ubiquitous figure in Israel since his son's capture, leading a highly visible campaign to keep the issue on the agenda. In the summer of 2010, he led days of nationwide marches calling on the government to press for his release, and for years he maintained a protest tent outside the prime minister's residence in Jerusalem.
The United States awkwardly welcomed Tuesday's release, with Secretary of State Hillary Rodham Clinton saying the U.S. was pleased that Schalit's ordeal was over and that "he was held for far too long in captivity."
But Clinton and other U.S. officials avoided specifically addressing Hamas' part in the agreement or the merit of Israel's decision to free more than 1,000 Palestinians to secure Schalit's release.
The sense of joy upon Schalit's return was palpable throughout Israel, where military service is mandatory and the captive soldier had been collectively adopted as a national son. The country's media covered the event with special broadcasts throughout the day, and Israel's prime minister, defense minister and army chief lined up to hug Schalit upon his arrival at an air base.
But the joy was tempered by the knowledge that hundreds of militants responsible for deadly attacks during the second Palestinian intifadah last decade were walking free.
Among them were the mastermind of a 2002 Passover suicide bombing that killed 30 people in a hotel, and a woman who lured a lovelorn Israeli teenager over the Internet to come to the West Bank, only to have him killed by waiting militants.
After meeting with Schalit, Prime Minister Benjamin Netanyahu said he understood the pain of Israeli families who have lost relatives in Palestinian attacks, but that Israel's history of doing everything possible to bring its soldiers home safely compelled him to act.
Israel has a long history of numerically uneven exchanges, though Tuesday's swap was the most lopsided and the first time since 1985 that it has brought home a soldier who was still alive.
The unequal terms of Tuesday's exchange only underscored the sense of a victory for the Iran-backed militant Hamas, which has ruled the Gaza Strip since 2007 and continues to be dedicated to Israel's destruction.
Those concerns were underscored by the celebrations in the Palestinian areas, where both prisoners and demonstrators called for more soldier kidnappings to bring home prisoners who remain in Israel.
"My happiness is indescribable," said Azhar Abu Jawad, who was celebrating the return of a brother who had been sentenced to life for killing an Israeli in 1992.
"We'll get him a bride and everything. I just spoke to him. He's so happy. This is a reminder God doesn't forget anyone," she said.
Some observers had hoped that in striking the deal, Hamas and Israel might have somehow gotten past the mutual hatred, perhaps setting the stage for an easing of Israel's blockade of Gaza or even an inclusion of Hamas in peace talks.
But Israel denied any easing would come, and Hamas officials stressed their interest in seizing more Israeli soldiers to trade for the thousands of Palestinians that remain behind Israeli bars.
In the West Bank, where he leads a rival government, Abbas addressed a crowd of several thousand, including released prisoners and their relatives. In an attempt at unity, he shared a stage with three Hamas leaders.
Still, Abbas is likely to suffer politically as a result of the swap, the most significant for the Palestinians in nearly three decades. With peace talks stalled for the past three years, Abbas is in the midst of a unilateral bid at the U.N. to win recognition of an independent state. Weakened by the prisoner swap, he now seems even less likely to return to negotiations unless they are accompanied by major concessions by Israel.
Ibrahim Barzak and Diaa Hadid in Gaza City, Gaza Strip, Mohammed Daraghmeh in Ramallah, West Bank, Tia Goldenberg in Jerusalem and Daniella Cheslow at Tel Nof Air Base, Israel, contributed to this report.