Iraqi Prime Minister Haider al-Abadi arrived in Mosul on Sunday afternoon after government forces virtually recaptured the city from the Islamic State group. Abadi’s office said he thanked “the heroic fighters and the Iraqi people for the great victory.”

Fighters from the Islamic State were pushed towards the banks of the river Tigris earlier in the day, and many of them jumped into the waters as the government forces advanced, Reuters reported. The troops raised the Iraqi flag on the riverbank, though some Islamic State fighters were believed to still be trapped in a small portion of the Old City.

Experts had said the fall of Mosul would be the biggest blow to the militant group.

The Iraqi forces had made strong inroads into the city over the past few months. On June 21, the Islamic State group blew up the Grand al-Nuri Mosque and its famous leaning minaret. At the time, Abadi had said this “amounts to an official acknowledgement of defeat”. It was at the mosque that the outfit’s leader Abu Bakr al-Baghdadi had declared himself the “caliph” in 2014 in his only public appearance.

The militant group had seized Mosul, Iraq’s second-biggest city, in June 2014. On October 17, 2016, Iraqi forces backed by a United States-led coalition had launched a major offensive to take the city back. More than a million people have been killed, thousands of civilians have been displaced and large parts of the city destroyed over the past nine months of fighting. The military campaign was seen as the country’s biggest since United States forces left its soil in 2011.