Israel's army says it has pulled out of the town of Beit Hanoun in the northern Gaza Strip, after a six-day operation targeting rocket-firing militants.
The operation at Beit Hanoun lasted six days
Witnesses confirmed Israeli troops had left. The army says it has taken up positions in surrounding areas.
Eyewitnesses said burned cars and broken sewage pipes littered streets where the fierce clashes had occurred.
Some 50 Palestinians, including about 16 civilians, were killed. The army says it found large quantities of arms.
Elsewhere in the Gaza Strip, Israeli forces have killed at least four gunmen and two civilians, militant groups and medics said.
At least two women died when an Israeli shell struck the home of Jamila Shanti, an MP from the ruling Palestinian party Hamas. The army said it was returning fire from the area.
Ms Shanti has been identified as the organiser of a women's protest on Friday to free militants sheltering in a mosque, that was fired on by Israeli troops killing two unarmed protesters.
Many of Beit Hanoun's residents poured into the streets to inspect the damage inflicted on their town by Israeli forces.
One resident described it as "the worst raid we have ever witnessed... This is the tsunami of Beit Hanoun".
Numerous buildings bore the scars of tank shells and one mosque was left with only its minaret standing, AFP reported.
Tens of thousands of residents had been ordered to stay indoors, leading to shortages of electricity and water.
Despite the crackdown, rockets have continued to be fired towards Israel, one hitting the border town of Sderot at the weekend, though no-one was hurt.
Israeli forces have made regular incursions into Gaza and the West Bank since the capture of an Israeli soldier in a cross-border raid by Palestinian militants on 25 June.
The Israeli pull-out came as Palestinian leader Mahmoud Abbas and Prime Minister Ismail Haniya prepared to hold more discussions on the formation of a unity government.
The talks are designed to ease the international embargo against the Hamas-led Palestinian Authority. The two men met late on Monday.
Foreign donors, including the US and the European Union, have boycotted the Palestinian government over Hamas' refusal to recognise Israel or to renounce violence.
The latest raids come 14 months after Israel withdrew its settlers and the troops who protected them from the Gaza Strip, which it occupied in 1967.