Hundreds of civilians fled Mosul’s Old City on Friday as Iraqi forces slowly squeezed the last pockets of Islamic State resistance, and the UN warned that the “intense and concentrated” fighting put innocent lives in even greater danger.

People climbed over mounds of rubble and through narrow alleys as gunshots and explosions rang out nearby. The neighborhoods where government forces are fighting have been under siege for months as grueling urban warfare drew out the operation to retake Iraq’s second-largest city.

For the civilians held as human shields by the extremists, supplies have run low and drinking water is scarce, according to residents interviewed at screening centres and clinics.

The battles came a day after Iraqi forces made significant gains against the militants and Prime Minister Haider al-Abadi declared an end to the group’s self-proclaimed caliphate.

After a dawn push on Thursday, Iraqi forces retook the symbolic site where the al-Nuri Mosque once stood. It was from the pulpit of the 12th century mosque, which the militants blew up last week along with its famous leaning minaret, that their leader Abu Bakr al-Baghdadi had proclaimed the caliphate in 2014.

During the evening, al-Abadi announced the full liberation of Mosul was near and that Iraq’s “brave forces will bring victory”.

Lt Gen Abdul Wahab al-Saadi said by Friday afternoon the special forces were within 700 metres of the Tigris River, which roughly divides Mosul into eastern and western halves.

The operation to retake Mosul, backed closely by the US-led coalition, began in October, with the Iraqi government initially vowing the city would be liberated in 2016.

Isis now holds a small patch of territory in Mosul’s Old City along the Tigris that measures less than two square kilometres (0.8 square miles). The terrain is dense, and the UN estimates tens of thousands of civilians are trapped there.

“We don’t feel the end yet, to be honest. It’s still full on,” said Frederic Cussigh, head of the UNHCR Irbil office. About 1,400 people fleeing the Old City have been registered at screening centres in the past two days, he added.

“Regardless of the outcome of the battle, the humanitarian situation will be critical for a lot longer than we anticipated,” Cussigh said.

The clashes have displaced more than 850,000 people since the operation to retake Mosul was launched, according to the International Organisation for Migration.

An Isis media outlet, al-Nabaa, on Thursday quoted an unidentified militant commander as saying the battle for Mosul is a fight “either to achieve victory or die as a martyr.”

Iranian President Hassan Rouhani tweeted his congratulations Friday to the city’s residents and the Iraqi people on the “breeze of freedom in Mosul after three years of occupation, violence and killing”.

Isis also is under increased pressure in Syria, where its self-proclaimed capital of Raqqa is encircled by an array of forces, closely backed by the coalition. Despite a series of recent losses in both Iraq and Syria, al-Baghdadi’s fate remains unknown.