Israeli tanks and troops have begun pulling out of Gaza after their leaders and Hamas militants both declared ceasefires.

For the first time since Dec. 27, civilians in Gaza could sleep in relative safety.

The halt in combat also allowed rescue workers into areas that were once too dangerous, leading to the discovery of about 100 bodies from building destroyed in bombs.

Hamas launched about 20 rockets into southern Israel Sunday morning just before the ceasefire was declared. Three Israelis were hurt.

Israel and Hamas don't officially recognize each other and agreed to separate ceasefire agreements.

Daoud Shihab, speaking on behalf of Islamic Jihad, said that other, smaller militant groups will also abide by the ceasefire.

According to Shihab, the militants will also seek the re-opening of border crossings into Gaza.

Deputy Hamas leader Moussa Abu Marzouk announced plans of the ceasefire on Syrian television.

"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," Abou Marzouk said.

Israeli Prime Minister Ehud Olmert says his country will leave Gaza quickly if the cease-fire 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 said he was saddened over the deaths of civilians in Gaza, calling them "hostages of the Hamas murders" and said he would prevent a humanitarian crisis in the territory.

The militant's move comes about 12 hours after Israel's security cabinet agreed to halt its military offensive in the Gaza Strip after three weeks of fighting in the territory.

However, Israel has said its soldiers will remain in Gaza while a long-term truce is established, with international help.

Israeli officials have also warned that they will only honour their end of the truce if militants cease firing rockets into its territory.

"Israel's decision allows it to respond and renew fire at our enemies, the different terror organizations in the Gaza Strip, as long as they continue attacking," Olmert said at the start of the weekly Cabinet session earlier.

Since the start of the fighting, nearly 1,200 Palestinians have been killed, at least half of them civilians, according to local medics.

Thirteen Israelis have died, including three civilians.

The tentative truce led some civilians to load up vans and donkey carts with their belongings and venture back to their homes.

With files from The Associated Press