Israeli troops have pulled out of the Gaza Strip more than 38 years after capturing the narrow coastal area.
Tanks and armoured vehicles left under cover of darkness and the last officer shut the Kissufim border at dawn.
Thousands of jubilant Palestinians entered the former Jewish enclaves, and some set an abandoned synagogue ablaze in a settlement near Khan Younis.
Palestinian leader Mahmoud Abbas described the withdrawal as an historic and joyful day for his people.
But he told the BBC that some issues remained to be resolved.
Mr Abbas said factors include Israel's insistence on determining who can enter or leave Gaza, and its control of Gaza's airspace and the waters off its coast.
Israel declared a formal end to military rule on Sunday before its remaining 3,000 troops left.
"The mission has been completed," said Gaza commander Brig Gen Aviv Kochavi, the last soldier to leave the occupied territory.
Departing troops held a flag raising ceremony outside the strip
Israel had already removed its settlers from Gaza, bulldozed their homes and demolished its military bases.
The government did not to raze the Strip's more than 20 deconsecrated synagogues after rabbis said it was forbidden to do so.
Palestinian officials had urged Israel to pull them down, given their concerns that they could not protect the buildings from desecration.
As the Israelis pulled out, fireworks exploded over Neve Dekalim, one of the largest settlements.
Palestinian forces in red berets planted their flag inside the former enclave.
Plans to bar crowds of civilians and armed militants from the settlements quickly disintegrated, and people poured in and attacked the hated symbols of occupation.
Hours after the initial euphoria, hundreds remained. Groups of gunmen have been exploring Israel's now-disused military watchtowers.
"Today is the happiest day in my life," Jawad Abu Lafi told Reuters, after praying at the former settlement of Ganei Tal.
The BBC's Alan Johnston says Palestinians from Deir al-Balah found a desolate and chaotic scene as the streamed into the nearby Kfar Darom settlement.
The Israelis smashed most things before they left, he says, but Palestinians have been scavenging through the rubble - retrieving wood, metal and broken pipes.
Israel will retain control over the territory's air and sea space and, at least temporarily, all its borders.
The Israelis say they have to prevent militant groups smuggling in weapons but the Palestinians say that as long as Israel controls all Gaza's links with the outside world, the occupation will continue.
The Palestinian Authority says it will continue to insist on total freedom of movement between Gaza and Egypt - otherwise, they add, the Israeli occupation of Gaza will not have really ended.