Smoke billows from behind the Great Mosque of al-Nuri in Mosul's Old City on April 17, 2017, during an offensive by Iraqi security forces to recapture the city from Islamic State.

After eight months of grinding urban warfare, Iraqi government troops on Thursday captured the ruined mosque at the heart of Islamic State's de facto capital Mosul, and the prime minister declared the group's self-styled caliphate at an end. Iraqi authorities expect the long battle for Mosul to end in coming days as remaining Islamic State fighters are bottled up in just a handful of neighborhoods of the Old City. For the Iraqi forces fighting to recapture Mosul, the seizure of the nearly 850-year-old Grand al-Nuri Mosque - from where Islamic State proclaimed the caliphate three years ago - is a huge symbolic victory. "The return of al-Nuri Mosque and al-Hadba minaret to the fold of the nation marks the end of the Daesh state of falsehood," Prime Minister Haider al-Abadi said in a statement, referring to the ultra-hardline Sunni group by an Arabic acronym. "Their fictitious state has fallen," an Iraqi military spokesman, Brigadier General Yahya Rasool, told state TV. The fall of Mosul would in effect mark the end of the Iraqi half of the IS caliphate, although the hardline group still controls territory west and south of the city. Its stronghold in Syria, Raqqa, is also close to falling. A U.S.-backed Kurdish-led coalition besieging the city on Thursday fully encircled it after closing the militants' last way out from the south, the Syrian Observatory for Human Rights monitoring group said.

Iraqi forces flash the sign for victory while holding an Islamic State (IS) group flag on February 23, 2017, as they enter Mosul airport on the southern edge of the jihadist stronghold for the first time since the Islamic State group overran the region in 2014. Ahmad Al-Rubaye | AFP | Getty Images

Islamic State fighters blew up Mosul's medieval mosque and its famed leaning minaret a week ago as U.S.-backed Iraqi forces started a push in its direction. Their black flag had been flying from al-Hadba (The Hunchback) minaret since June 2014. Much of the mosque and brickwork minaret was reduced to rubble, said a Reuters TV reporter who went to the site with the elite units that captured it. Only the stump of the Hunchback remained, and a green dome of the mosque supported by a few pillars which resisted the blast, he said. The mosque grounds were off limits as the insurgents are suspected to have planted booby traps. Abadi "issued instructions to bring the battle to its conclusion," by capturing the remaining parts of the Old City, his office said. The cost of the fighting has been enormous. In addition to military casualties, thousands of civilians are estimated to have been killed. About 900,000 people, nearly half the pre-war population of the northern city, have fled, mostly taking refuge in camps or with relatives and friends, according to aid groups. Those trapped in the city suffered hunger and deprivation as well as death or injury, and many buildings have been ruined.

Arduous task

Counter Terrorism Service (CTS) troops captured the al-Nuri Mosque's ground in a "lightning operation" on Thursday, a commander of the U.S.-trained elite units told state TV. CTS units are now in control of the mosque area and the al-Hadba and Sirjkhana neighborhoods and they are still advancing, a military statement said. Other government units, from the army and police, were closing in from other directions. An elite Interior Ministry unit said it freed about 20 children believed to belong to Yazidi and other minorities persecuted by the jihadists in a quarter north of the Old City which houses Mosul's main hospitals. A U.S.-led international coalition is providing air and ground support to the Iraqi forces fighting through the Old City's maze of narrow alleyways. But the advance remains arduous as IS fighters are dug in the middle of civilians, using mortar fire, snipers, booby traps and suicide bombers to defend their last redoubt. The military estimated up to 350 militants were still in the Old City last week but many have been killed since. They are besieged in one sq km (0.4 square mile) making up less than 40 percent of the Old City and less than one percent of the total area of Mosul, the largest urban centre over which they held sway in both Iraq and Syria.