Islamic State militants threw themselves into the Tigris on Sunday, trying to flee the battlefield in Mosul as Iraqi forces reached the riverbank, bringing them to the verge of victory.
After eight months of combat that has left parts of the city in ruins, killed thousands of civilians and displaced nearly one million people, Iraqi officials say they have almost regained full control of Mosul.
The militants have been driven from all but a patch of territory on the western bank of the Tigris bisecting Mosul, where they have staged a last stand in the narrow alleys of the Old City.
Plumes of smoke rose over the Old City on Sunday and the decaying corpses of Islamic State fighters lay in the streets. Scattered bursts of gunfire could be heard and several airstrikes were carried out.
Iraqi military spokesman, Brigadier General Yahya Rasool, told state TV earlier on Sunday that 30 militants had been killed attempting to get away by swimming across the Tigris.
Later, Iraqiya News ran an on-screen headline saying the Counter Terrorism Service (CTS) had raised the Iraqi flag on the Tigris riverbank in the Old City after retaking the Maydan area, and was now advancing toward the Qalayat area.
Islamic State vowed on Saturday to "fight to the death" in Mosul.
Cornered in a shrinking area of the city, the militants have resorted to sending women suicide bombers among the thousands of civilians who are emerging from the battlefield wounded, malnourished and fearful.
The battle has also exacted a heavy toll on Iraq's security forces.
The Iraqi government does not reveal casualty figures, but a funding request from the U.S. Department of Defense said the CTS, which has spearheaded the fight in Mosul, had suffered 40 percent losses.
The United States leads an international coalition that is backing the campaign against Islamic State in Mosul by conducting airstrikes against the militants and assisting troops on the ground.
The Department of Defense has requested $1.269 billion in U.S. budget funds for 2018 to continue supporting Iraqi forces.
Without Mosul - by far the largest city to fall under militant control - Islamic State's dominion in Iraq will be reduced to mainly rural, desert areas west and south of the city where tens of thousands of people live.
It is almost exactly three years since the ultra-hardline group's leader Abu Bakr al-Baghdadi proclaimed a "caliphate" spanning Syria and Iraq from the pulpit of the medieval Grand al-Nuri mosque.
Prime Minister Haider al-Abadi declared the end of Islamic State's "state of falsehood" a week ago, after security forces retook the mosque - although only after retreating militants blew it up.
The United Nations predicts it will cost more than $1 billion to repair basic infrastructure in Mosul. In some of the worst affected areas, almost no buildings appear to have escaped damage and Mosul's dense construction means the extent of the devastation might be underestimated, U.N. officials said.
The militants are expected to revert to insurgent tactics as they lose territory.
The fall of Mosul also exposes ethnic and sectarian fractures between Arabs and Kurds over disputed territories or between Sunnis and the Shi’ite majority that have plagued Iraq for more than a decade.