The July-August conflict between Israel and Islamist movement Hamas, which rules the Gaza Strip, left 100,000 Gazans homeless and forced many to seek refuge in schools belonging to the UN's Palestinian refugee agency, UNRWA.
"Some 30 families left the shelter of the Bahrain school (in western Gaza City), where up to 1,100 displaced people had been living," UNRWA spokesman Adnan Abu Hasna told AFP.
It was the final UN building being used as a shelter for those displaced in the war, he said.
The United Nations has stressed the need for its schools being used as shelters to be able to function fully as educational institutions.
UNRWA gave between $800 and $1000 (700-875 euros) to each family to be spent on temporary accommodation for several months, Abu Hasna said.
He said that the amount of money the agency could continue giving families would "depend on donor support."
Reconstruction of the tens of thousands of homes destroyed during the war has not yet begun, although repairs have been made to a number of partially damaged buildings, UNRWA says.
Gazans who lost their homes are either staying with relatives, in temporary accommodation such as apartments, or living under makeshift canvas tents in the ruins of their bombed-out houses.
At the height of the conflict, some 300,000 displaced Palestinians were sheltering in some 91 UN schools, several of which were hit by Israeli strikes.
Israel maintains it needed to target those facilities because Palestinian militants were using the areas to store weapons and fire rockets.