GAZA (Reuters) - More Israeli forces left the Gaza Strip on Monday after a 22-day assault on Hamas militants, and both sides kept a ceasefire, allowing dazed Palestinians to survey the destruction and mourn their dead.

In Jabalya refugee camp, the scene of heavy fighting, not a house was unscathed. Huge piles of uncollected garbage rotted on street corners. Children scavenged for empty plastic bottles.

Israel withdrew its forces from built-up parts of coastal Gaza, Israel Radio said. Political sources said Israel would complete its troop pullout by Tuesday, before Barack Obama is sworn in as U.S. president.

Israel was seen by some as interested in having its troops back home by the time Obama takes office to avoid any friction with its closest ally’s new leader.

U.N. Secretary-General Ban Ki-moon, on a Middle East tour, planned to visit the coastal enclave and Israel the same day, officials said. He would be the first world figure to go to Gaza since Israel halted its devastating offensive on Sunday.

A spokesman for Hamas’s armed wing, his face masked by a checkered Arab scarf, vowed it would replenish its arsenal of rockets and other weapons, in defiance of any Israeli or international efforts to cut off smuggling routes.

“Do whatever you want, bringing in and manufacturing the holy weapons is our mission, and we know how to acquire weapons,” the spokesman, Abu Ubaida, told a news conference.

Israel and Hamas separately declared ceasefires on Sunday, the Islamist group demanding an Israeli pullout within a week.

Troops and tanks poured into Gaza on January 3 to try to quell Hamas rocket attacks after a week-long Israeli air campaign.

Bulldozers cleared rubble from streets and the Palestinian statistics bureau put the total repair bill at $1.9 billion.

A Hamas official said 5,000 homes, 16 government buildings and 20 mosques were destroyed and 20,000 houses damaged. Israel has said militants used mosques as weapons depots.

Saudi Arabia’s King Abdullah pledged $1 billion for rebuilding. Israel reopened three border crossings to allow more basic goods to reach the territory of 1.5 million Palestinians.

Palestinians emerged from hiding, shocked at the killing of more than 1,300 fellow residents of Gaza and at the widespread destruction of homes and government infrastructure.

“We want a solution that would guarantee Israeli tanks do not return to kill us,” said Yehya Aziz, a 22-year-old Gazan.

Gaza medical officials said the Palestinian death toll included at least 700 civilians. Israel, which accused Hamas of endangering non-combatants by operating in densely populated areas, said hundreds of gunmen were among the dead.

According to figures released by Hamas and other militant groups, 112 of their fighters and 180 Hamas policemen were killed. Israel put its dead at 10 soldiers and three civilians.

The only violence on Monday was in the occupied West Bank where a Palestinian shot and seriously wounded a Jewish settler, police said. Hamas had threatened renewed attacks to avenge the Gaza offensive, but made no immediate claim of responsibility.

Slideshow ( 26 images )

Western powers had pushed for a Gaza ceasefire. While publicly sympathetic to Israel’s security concerns, they had voiced alarm at mounting civilian casualties and hardship.

The crisis clouded the last days of the Bush administration. It spelled Middle East challenges that Obama may find no less insurmountable than those faced by his predecessors.

“VICTORY”

Ismail Haniyeh, head of the Gaza-based Hamas administration, claimed a “popular victory” against Israel. In a speech, he called Hamas’s ceasefire decision “wise and responsible.”

Slideshow ( 26 images )

Abu Ubaida, speaking on behalf of Hamas’s Izz el-Deen al-Qassam Brigades, said “all options would be open” if Israel did not meet the group’s pullout deadline.

Israel launched its air, ground and sea assault on December 27 vowing to “change the reality” for southern border towns that had taken rocket fire from Hamas and other groups since 2001.

Israeli Prime Minister Ehud Olmert has declared the mission accomplished, noting diplomatic efforts by the United States, Egypt and European nations to prevent Hamas rearming.

That would mean as yet unspecified measures to stop Hamas smuggling weapons across the Egypt-Gaza frontier, a sensitive matter given Cairo’s past efforts to play down its scope.

Israeli Internal Security Minister Avi Dichter threatened a military response to any renewed flow of arms into Gaza, saying Israel would view such smuggling as an attack on its territory.

Hamas official Mushir al-Masri said talks continued in Cairo on Egypt’s proposal for a long-term ceasefire that would assure the reopening of crossings, including the Rafah terminal with Egypt that had been Gaza’s main access to the outside world.

The European Union offered to help by announcing plans to convene foreign ministers in Brussels to discuss proposing humanitarian aid and ways to prevent weapons smuggling to Gaza.

Mark Regev, a spokesman for Olmert, said “enormous amounts” of aid could be allowed in if the quiet holds.

For now, Gaza’s situation looks much as it did before the conflict -- armed standoff and a dim future for the 1.5 million people fenced inside the strip by a blockade aimed at punishing Islamist Hamas for rocket fire and ambitions to destroy Israel.

In Kuwait, Palestinian President Mahmoud Abbas urged feuding factions to form a unity government to pave the way for simultaneous parliamentary and presidential elections. There is little sign Hamas or Abbas’s Fatah group are ready to reconcile.

Hamas won a 2006 election, but Israel and the West boycotted the governments it led. The Islamists drove forces loyal to Western-backed Abbas from the Gaza Strip 18 months later, prompting Abbas to appoint a new government in the West Bank.