Iraqi security forces are clearing the final pockets of resistance by Islamic State militants in the city of Mosul.
Prime Minister Haider al-Abadi went to Mosul on Sunday to congratulate his troops on “liberating” the city, but he stopped short of declaring victory.
The militants were said to hold an area about 180m (590ft) long and 45m wide.
The battle for Mosul has taken almost nine months, left large areas in ruins, killed thousands of civilians and displaced more than 920,000 others.
Commanders from the US-led coalition that has provided air and ground support to Iraqi forces said the urban combat had been most intense since World War Two.
Although Mr Abadi made no formal declaration of victory on Sunday, he stressed that it was “just around the corner”.
Using a pejorative term for IS based on an Arabic acronym of its former name, he said the “remnants of Daesh are besieged in a few inches” and expressed “appreciation for the heroic forces determined to put an end to the myth of Daesh for good”.
“One or two pockets are still controlled by IS militants who have no more than two options: to surrender or to be killed,” he added.
On Monday morning, Iraqi army officers estimated that only a few dozen militants were still putting up resistance in a small part of the Old City, near the western bank of the River Tigris. Most of the civilians left there were believed to be members of the militants’ families, who were being used as human shields, they added.
The BBC’s Jonathan Beale in Mosul says a steady stream of civilians, weak through hunger and lack of water, is still being led out of the Old City.
Search and rescue teams have also been pulling out many bodies from mountains of rubble, our correspondent adds.
The UN estimates that the fighting on the ground and air strikes have damaged more than 5,000 buildings and destroyed 490 in the densely-populated Old City alone.
“It’s a relief to know that the military campaign in Mosul is ending. The fighting may be over, but the humanitarian crisis is not,” said the UN Humanitarian Coordinator in Iraq, Lise Grande.
“Many of the people who have fled have lost everything. They need shelter, food, health care, water, sanitation and emergency kits. The levels of trauma we are seeing are some of the highest anywhere. What people have experienced is nearly unimaginable.”
- Where is ‘Islamic State’ leader Abu Bakr al-Baghdadi?
- After Mosul: The Iraqi towns still under IS control
IS militants overran Mosul in June 2014, before seizing control of large parts of northern and western Iraq. The following month, Abu Bakr al-Baghdadi made his first and only public appearance as IS leader at the city’s Great Mosque of al-Nuri, and gave a speech proclaiming the creation of a “caliphate”.
IS blew up the mosque almost exactly three years later as Iraqi troops prepared to retake it – a move Iraq’s prime minister called a “formal declaration of defeat”.
Our correspondent says the jihadists may have lost militarily in Mosul, but this is not their end in Iraq nor the end of their twisted ideology.
IS still controls territory in three areas of Iraq – around Hawija, 130km (80 miles) south-east of Mosul; around Tal Afar, 65km west; and from Ana to Al-Qaim in the Euphrates river valley, 250km to the south-west.
IS also holds a string of towns along the Euphrates in Syria, including Albu Kamal and Mayadin, but its stronghold of Raqqa is besieged by US-backed fighters.