By Jihan Abdalla and Nidal al-Mughrabi

RAMALLAH/GAZA (Reuters) - Israel released 550 Palestinian prisoners Sunday in the second stage of a deal with Hamas that brought home soldier Gilad Shalit after five years of captivity in the Gaza Strip.

While many of the 450 prisoners freed on October 18 in the first phase of the Egyptian-brokered prisoner swap were serving life sentences for deadly attacks, none in the second group was convicted of killings.

Nearly all of the prisoners passed through a crossing into the West Bank and were greeted by thousands of Palestinians who danced and cheered in the city of Ramallah.

Though Hamas, which rules the Gaza Strip, had reached the deal with Israel, most of the crowd waved flags from the rival Fatah faction of Palestinian President Mahmoud Abbas, the dominant party in the West Bank.

In Gaza, two buses with 41 prisoners, escorted by the International Committee of the Red Cross, passed through the Rafah crossing and were met by hundreds of relatives waving flags representing the different Palestinian factions.

"My feelings of joy are mixed with sorrow because we left behind beloved brothers, we hope all of them will be freed," said Samer Aweidat, who was released after serving four years of a six-year sentence for weapons possession and being a member of a miltant group.

Israel's Supreme Court opened the way for Sunday's release to go ahead by turning down a petition Friday from Israelis opposed to freeing the prisoners, whose terms ranged from a few months to 18 years.

They were convicted of crimes that included attempted murder, planting bombs and membership of militant groups.

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 held incommunicado in the Hamas-ruled territory and a huge majority of Israelis backed the deal that brought him home two months ago.

Hani Habib, a political analyst in Gaza, said that Israel, given the opportunity to pick which prisoners would be freed in the second stage, chose inmates from Fatah rather than Hamas.

"Israel was interested in turning the victory that has been achieved into a Palestinian discomfort and a Palestinian division with its discrimination," he said.

Hamas said it would petition Egypt to pressure Israel into freeing all the Palestinian women in its jails, something it had wanted to happen in Sunday's release.

(Writing by Jeffrey Heller)