Residents say dozens of fighters taking up positions near the medieval mosque where ISIL’s leader declared a caliphate.

Fighters from the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) have closed the streets around Mosul’s Grand al-Nuri Mosque, residents said, apparently in preparation for a final showdown in the battle against Iraqi forces over their last major stronghold in the country.

Residents observed dozens of fighters taking up positions in the past 48 hours around the medieval mosque, the site where ISIL leader Abu Bakr al-Baghdadi declared a caliphate in July 2014.

ISIL’s black flag has been flying from the mosque since the fighters captured Mosul and seized swaths of Iraq and Syria in the summer of 2014.

“Daesh’s fighters know that the mosque is the most important target and they are preparing for a major battle there,” said Hisham al-Hashemi, who advises several Middle East governments, including Iraq’s, on ISIL, using “Daesh”, the Arabic acronym for the group.

READ MORE: ISIL’s ‘caliph’ lauds Iraq rebellion

Military sources said the move by ISIL fighters was aimed at preventing any infiltration by advancing Iraqi forces, who are closing in on the remaining pockets of territory held by the armed group.

The fall of the city would, in effect, mark the end of the Iraqi half of the self-styled caliphate. Meanwhile, in Syria, Kurdish forces backed by US air raids are besieging ISIL forces in the city of Raqqa, the fighters’ de facto capital in that country.

Up to 200,000 people still live in harrowing conditions behind ISIL lines in Mosul, running low on food, water and medicine.

Civilians fleeing the fighting told Al Jazeera about the terrible conditions they have been living in.

Tired and panicked, they described starving conditions with limited access to water

A fleeing man said that during the Muslim fasting month of Ramadan, which is currently under way, he has been surviving on flour and water.

An older woman said that they were being treated as prisoners and had no food or water.

Iraqi forces launched a major US-backed operation to retake Mosul in October last year, fighting their way to the city and retaking its eastern side before setting their sights on its smaller but more densely populated west.

The battle has taken a heavy toll on civilians, pushing hundreds of thousands to flee, while hundreds more have been killed or wounded.

Iraqi forces help women who fled their homes during a fight in Mosul’s Zanjili neighbourhood [Alaa Al-Marjani/Reuters]

Final push

The Grand al-Nuri Mosque has become a symbolic focus of the campaign with Iraqi commanders privately saying they hope to capture it during Ramadan.

But a battle in or near the mosque would put the building and its famed leaning minaret at risk, experts say.

The minaret, several metres off the perpendicular and standing on humid soil, is particularly vulnerable as it has not been restored since 1970. Its tilt gave the landmark its popular name – al-Hadba, or the hunchback.

The Mosul offensive has taken much more time than expected as ISIL is fighting in the middle of civilians and using them as human shields.

READ MORE: Focus on al-Nuri Mosque as residents flee Mosul

Over the past few days, fighters ordered dozens of families living in the Zanjili district to move into the Old City to prevent them from escaping towards the Iraqi forces trying to advance from the northern side, a resident said.

Government forces have been dropping leaflets over the districts telling families to flee, but the intensity of fighting has prevented people from escaping.

ISIL is countering the offensive with suicide car and motorbike bombs, snipers, booby traps and mortar fire.

About 700,000 people, or one-third of the prewar city’s population, have already fled, seeking refuge with friends and relatives or in camps.