Israeli forces have pulled out of Jabalia in northern Gaza, after a three-week offensive there which saw tens of thousands of civilians flee the area.
The military said "hundreds of terrorists [had been] eliminated" and 10km (6 miles) of tunnels destroyed during the operation.
Pictures from Jabalia show widespread destruction, with multi-storey buildings reduced to rubble or bombed out shells.
The Israel Defense Forces (IDF) had gone back into the city months after pulling out, saying that Hamas was regrouping there.
During the operation, the bodies of seven Israelis killed during the Hamas attack on Israel on 7 October and taken to Gaza were discovered and repatriated.
The Times of Israel said IDF officers had described the fighting in Jabalia as some of the most intense of the war. The IDF said Hamas had "turned the civilian area into a fortified combat compound, fired towards the troops from sheltered areas and schools, and built an underground terrorist network from within civilian buildings".
It said it had destroyed rocket launchers "ready for use" and several weapons production sites.
The IDF's second ground operation in Jabalia came four months after it had declared it had dismantled Hamas's military capabilities in northern Gaza.
The war itself could go on for at least the rest of the year, a key aide to Israeli Prime Minister Benjamin Netanyahu said on Wednesday.
Meanwhile, the prospect of renewed ceasefire talks has further dimmed after Hamas said on Thursday that it would not negotiate "in light of [Israel's] aggression, killing, siege, starvation and genocide of our people".
It said it had told mediators that it would be ready to reach "a complete agreement" if Israel stopped the war. Israel has said it will fight on until it has achieved its aims of destroying Hamas and returning its hostages.
The war began in October when Hamas gunmen launched an unprecedented attack on Israel, killing about 1,200 people and taking 252 back to Gaza as hostages.
More than 36,000 people in Gaza have been killed in the Israeli offensive, the territory's Hamas-run health ministry says.