About half of the prisoners were serving four years or less, and a third of them two years or less, often for offenses like throwing stones or incendiary bombs or possessing weapons. About 10 percent had sentences of 10 years or more, mostly for throwing or planting bombs or attempted murder. Ten percent are younger than 18; three of the prisoners are 14 years old.

Some Palestinians expressed anger that the release took place at night, making it hard to celebrate, and said that those being freed were not the ones they would have chosen.

“This is not a serious part of the exchange,” Issa Qaraqe, the Palestinian minister of detainees for the West Bank-based Palestinian Authority, said in a telephone interview. “Many of those being released were due to get out within months anyway, and there are women left behind and prisoners who have been there a long time. If Israel had wanted to make a real good-will gesture, the list would have been totally different.”

Under the deal, Israel picked the prisoners released in the second group, with the only condition being that they be security prisoners and not those convicted of common crimes.

In Gaza, a spokesman for Hamas, Salah al-Baradweel, said Israel seemed to be punishing Gaza by freeing so few prisoners from there: 41 of the 550. Mid-level Hamas officials were slated to receive the freed detainees. Ihabal Ghussein, spokesman for the Hamas Interior Ministry, said a larger celebration would come later.

Mr. Shalit, who was 19 when he was abducted while on active duty near the Gaza border in 2006, emerged thin and pale when the first phase of the exchange took place. He is now home with his family in northern Israel and undergoing occupational therapy and debriefing by the military, according to Israeli news media reports.