Iraqi Prime Minister Haider al-Abadi has urged all Iraqis to rejoice, after the recapture of the city of Falluja from Islamic State (IS) fighters.
It came after the army said it had seized the last IS stronghold in the city, 50km (30 miles) west of Baghdad.
Mr Abadi appeared on television outside Falluja's main hospital, waving an Iraqi flag.
He said the security forces would soon raise the flag in Mosul in the north - the biggest Iraqi city held by IS.
"Today our troops liberated Falluja while at the same time our troops are currently fighting in Mosul," he said.
"There is no place for Isis [IS] in Iraq. We will chase them everywhere. As we promised to raise the flag high in Falluja, we will raise it in Mosul soon with the will of our heroes. I call on Iraqis to celebrate this day."
IS seized control of Falluja in January 2014. The government launched an operation to retake it in May.
At least 1,800 militants were killed in the operation, the Iraqi army said.
Alan Johnston, BBC Middle East analyst
If the capture of the Golan neighbourhood marks the end of the battle for Falluja, then this is a significant moment.
The IS militants have lost a city of much symbolic and strategic importance just an hour's drive from Baghdad.
But this victory came at a high cost for Falluja's people. They have faced extraordinary danger and hardship during the fight for the city. And securing a military triumph was only part of the challenge that the government faced in Falluja.
If there is to be long-term calm and stability there, the city's Sunni Muslims will need to be made to feel that the predominantly Shia authorities in Baghdad are listening to them, and taking into account their security, economic and other concerns.
Tens of thousands of people fled the fighting and some - including elderly people, women and children - remain camped out in the open in the summer heat, the Norwegian Refugee Council said.
Falluja, a major city in the western Anbar Province, was the first Iraqi city to fall to IS.
The jihadist group also managed to seize large swathes of territory in northern and western Iraq and eastern Syria in 2014, establishing a self-declared "Islamic Caliphate" in the territories it captured.
In recent weeks, the militants have lost control over several territories in both countries.
The city of Mosul is seen as the next battle for Iraqi forces. The northern city has been under IS control since 2014 and the Iraqi army launched an operation in March aiming to retake it.