GAZA CITY, Gaza Strip -

Hamas offered Israel an immediate weeklong truce Sunday, hours after Israel silenced its guns and grounded its aircraft, but the Palestinian group conditioned long-term quiet on a complete Israeli withdrawal from the territory.

Israeli tanks rolled out of Gaza later Sunday, and infantry soldiers walked across the border to Israel, their guns and packs slung over their shoulders.

The withdrawal from Gaza left wide scenes of destruction in its wake, with buildings flattened, and dozens of bodies recovered from the rubble.

Prime Minister Ehud Olmert said Israel would leave Gaza quickly if the ceasefire holds.

"We didn't set out to conquer Gaza, we didn't set out to control Gaza, we don't want to remain in Gaza and we intend on leaving Gaza as fast as possible," Olmert said at a dinner with the leaders of Britain, France, Germany and Spain.

He also expressed sorrow over the deaths of civilians in Gaza, calling them "hostages of the Hamas murders" and vowed to prevent a humanitarian crisis in the territory.

More than 1,200 Palestinians, half of them civilians, have died in the Israeli assault. Thirteen Israelis have also died.

Hamas rockets peppered southern Israel ahead of the Sunday's truce offer.

In Gaza, Palestinians loaded vans and donkey carts with mattresses and ventured out to see what was left of their homes after Israel's punishing air and ground assault. Bulldozers shoved aside rubble in Gaza City to clear a path for cars. Medical workers sifting through mounds of concrete said they recovered 100 bodies amid the debris.

Israel mounted the offensive three weeks ago to halt Hamas rocket attacks, but despite the latest barrage, the government spokesman said Israel's ceasefire offer stood.

The rocket attacks were originally sparked by Israel's siege of Gaza.

"We will honour our ceasefire as we said last night and will only act to defend ourselves if we see Hamas provocation," the spokesman, Mark Regev, said in response to the Hamas ceasefire announcement.

At least a dozen tanks and armoured personnel carriers rumbled back into Israel, with relieved crews waving "victory" signs with their fingers. Hundreds of soldiers, laden with equipment, walked through the rain. Some smiled, others looked weary, their faces smeared with war paint.

Israeli flags poked out of their packs and were attached to the tops of radio antennas.

The Israeli army refused to say how many troops had withdrawn, or how large a force would remain inside Gaza, but the government said an Israeli presence would stay until rocket fire halted entirely.

The Palestinian ceasefire was announced by military leaders in Gaza and in Damascus, Syria, the base of Gaza's exiled Hamas leaders. They did not set a time, but it appeared to be effective immediately.

In Damascus, Moussa Abu Marzouk, Hamas' deputy leader, told Syrian TV the ceasefire would last a week to give Israel time to withdraw and open all Gaza border crossings to let humanitarian aid into the embattled seaside territory.

"We the Palestinian resistance factions declare a ceasefire from our side in Gaza and we confirm our stance that the enemy's troops must withdraw from Gaza within a week," Abu Marzouk said.

The Hamas offer raised hopes that the ceasefire would stick more than a few hours. Palestinian fighters had fired 17 rockets into Israel on Sunday, slightly injuring three people, police said, even as foreign leaders tried cement an end to the war in Egypt. Israel briefly retaliated against the rocket assaults with air and artillery strikes.

In Gaza City, the Shahadeh family was loading mattresses into the trunk of a car, preparing to return home to the hard-hit northern Gaza town of Beit Lahiya.

"I've been told that the devils have left," said Riyadh Shahadeh, referring to the Israelis. "I'm going back to see how I'm going to start again. I don't know what happened to my house. ... I am going back there with a heart full of fear because I am not sure if the area is secure or not, but I have no other option."

In southern Israel, residents who have endured rocket attacks for eight years accused the government of stopping the offensive too soon. Israel declared the ceasefire before reaching a long-term solution to the problem of arms smuggling into Gaza, one of the war's declared aims.

Schools in southern Israel had remained closed in anticipation of the rocket fire that was swift to come. Shortly before the rocket fire resumed, the head of a parents association in the town of Sderot faulted the government for not reaching an agreement directly with Hamas, which Israel shuns.

"It's an offensive that ended without achieving its aims," Batya Katar said. "All the weapons went through Egypt. What's happened there?"

"The weapons will continue to come in through the tunnels and by sea," she said.

The Israeli operation angered the Muslim world, sparking dozens of demonstrations. On Sunday, Qatar announced that it had closed Israel's trade office in the small Gulf Arab state and ordered its staff to leave within seven days.

Qatar is the only Gulf Arab state that has ties with Israel.

In Ottawa, Foreign Affairs Minister Lawrence Cannon issued a statement welcoming the ceasefire.

"Canada welcomes Israel's decision to implement a unilateral ceasefire in Gaza. This announcement by Israel is an important and positive step," he said.

"Canada notes that Hamas has also indicated its willingness to implement a ceasefire.

"This too is a welcome development as it has always been Canada's position that Hamas and others who continue to fire rockets on Israel must stop immediately," Cannon added.