MOSUL, Iraq — Iraq’s prime minister declared an end to the Islamic State caliphate Thursday after Iraqi forces captured the compound of a landmark mosque in Mosul that was blown up by the militants last week.

“We are seeing the end of the fake Daesh state. The liberation of Mosul proves that,” Haider al-Abadi said using the Arabic acronym for the Islamic State in a statement posted to twitter. “We will not relent, our brave forces will bring victory.”

But even as the Iraqi leader issued his statement, heavy clashes continued to unfold in Mosul – filling field hospitals and forcing hundreds to flee.

The destroyed al-Nuri mosque retaken by Iraqi special forces Thursday after a dawn push is a hugely symbolic win. The site is where Islamic State leader Abu Bakr al-Baghdadi made his only public appearance in July 2014, declaring a self-styled Islamic “caliphate,” encompassing territories then-held by the Islamic State in Syria and Iraq.

Iraqi and coalition officials said militants blew up the mosque complex last week. The Islamic State has blamed a U.S. airstrike for the destruction, a claim rejected by a spokesman for the U.S.-led coalition who said coalition planes “did not conduct strikes in that area at that time.”

Thursday’s advances come as Iraqi troops are pushing deeper into the Old City, a densely populated neighborhood west of the Tigris River where Islamic State fighters are making their last stand in Iraq’s second-largest city. Clashes were ongoing into Thursday evening.

Last week, Iraqi forces launched the operation to retake the Old City’s narrow alleyways and dense clusters of homes, embarking on some of the most difficult urban combat in the fight to date. The Islamic State now holds less than a square mile of territory inside Mosul, but the advances have come at considerable cost.

Damaged and destroyed houses dot the route Iraqi forces have carved into the congested district and the stench of rotting bodies rises from beneath mounds of rubble.

“There are hundreds of bodies under the rubble,” said special forces Maj. Dhia Thamir, deployed inside the Old City. He said that all of the dead bodies along the special forces’ route were of Islamic State fighters.

Special forces Maj. Gen. Sami al-Aridi acknowledged that some civilians have been killed by airstrikes and artillery in the fight for the Old City. “Of course there is collateral damage, it is always this way in war,” he said.

“The houses are very old,” he said, referring to the Old City, “so any bombardment causes them to collapse completely.”

U.S.-led coalition spokesman Col. Ryan Dillon told reporters at the Pentagon that victory in Mosul was “imminent.”