Iraq's prime minister has formally declared victory over the so-called Islamic State group in Mosul, three years after the militants seized the city and made it the stronghold of a "caliphate" they said would take over the world.
"I announce from here the end and the failure and the collapse of the terrorist state of falsehood and terrorism which the terrorist Daesh announced from Mosul," Haider al-Abadi said in a speech shown on state television, using an Arabic acronym for IS.
A 100,000-strong alliance of Iraqi government units, Kurdish Peshmerga fighters and Shi'ite militias launched the offensive to recapture the northern city from the militants in October, with key air and ground support from a US-led coalition.
Abadi thanked troops and the coalition. But he warned that more challenges lay ahead.
"We have another mission ahead of us, to create stability, to build and clear Daesh cells, and that requires an intelligence and security effort, and the unity which enabled us to fight Daesh," he said before raising an Iraqi flag.
Iraq declared a week-long holiday to mark the victory. People celebrated in the streets of the capital Baghdad and southern cities.
Abadi arrived in Mosul yesterday to congratulate military commanders who have waged a nearly nine-month battle to recapture the city, many parts of which were reduced to rubble.
Gunfire and explosions could be heard earlier in the day as the last few Islamic State positions were pounded.
The coalition said in a statement Iraqi forces were in "firm control" of Mosul, but some areas still needed to be cleared of explosive devices and possible IS fighters in hiding.
Around the time of Abadi's announcement, the terrorist group released a statement claiming to have mounted an attack on Iraqi forces in Mosul. Reuters could not immediately verify the report.
As so-called Islamic State is defeated in Mosul, aid agencies warn of a humanitarian crisis. pic.twitter.com/lwnKfnd5K5
— RTÉ News (@rtenews) July 10, 2017
In the aftermath of victory in Mosul, Abadi's government faces the task of managing the sectarian tensions there and elsewhere that enabled Islamic State to win support, and the threat of a wave of revenge violence in the city.
The coalition warned that victory in Mosul did not mark the end of the group's global threat.
"Now it is time for all Iraqis to unite to ensure ISIS is defeated across the rest of Iraq and that the conditions that led to the rise of ISIS in Iraq are not allowed to return again," Lt. Gen. Stephen J. Townsend said in a statement.
US President Donald Trump congratulated Iraq and said Islamic State's days were numbered. US Secretary of State Rex Tillerson called the victory "a critical milestone" in the war against Islamic State.
The militants are likely to keep trying to launch attacks on the West and inspiring violence by "lone wolves" or small groups of the kind mounted recently in Britain, France and elsewhere.
But the loss of Iraq's second-largest city is a grave body blow to Islamic State.
Much of the city of 1.5 million has been destroyed in the fighting, its centuries-old stone buildings flattened by airstrikes and other explosions.
Thousands of people have been killed. The United Nations says 920,000 civilians have fled their homes since the military campaign began in October. Close to 700,000 people are still displaced.
"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 a UN Humanitarian Coordinator for Iraq.
"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."