Israel released 477 prisoners, most of them to the Gaza Strip, where they were greeted as they exited buses, the Palestinian Ma'an news agency reported.
Hamas officials estimated more than 200,000 people rallied in Gaza.
"We are going home with dignity, thank God," one prisoner shouted to an Egyptian television station while on the bus bearing the Red Cross insignia.
The prisoners were part of a swap with Israel negotiated for the release of Israeli soldier Gilad Shalit, who was held captive for more than five years after being captured by Hamas during fighting. Israel agreed to release 1,027 Palestinian and Israeli Arab prisoners in phases for the return of Shalit.
Shalit was released to Israeli officials Tuesday.
In the West Bank, classes were suspended so students could participate in the celebrations, teachers' union leader Muhammad Suwwan told Ma'an.
"We thank God that you returned safe and sound to your families, your brothers, and your homeland after this forced disappearance because you struggled for your homeland," Palestinian Authority President Mahmoud Abbas said from his compound as the buses traveled to Ramallah.
"We pray that God enables us to see our sisters and brothers freed in this yard. Your sacrifices, and efforts and work were not in vain," Abbas said. "You worked and struggled and sacrificed. You will see the results of your sacrifices in the independent Palestinian state."