After nine gruelling months of street-to-street fighting and near-continuous aerial bombardment, Iraqi forces in July 2017 wrested control of Mosul, Iraq's second-largest city, from the brutal hands of ISIS.
Months in the making, the victory could not have come when it did without intense support from a US-led coalition that helped to arm, train and equip Iraqi soldiers.
It also provided key information and air support to the local forces that only three years earlier had been humiliated by the speed and scope of the ISIS advance.
Mosul's liberation stands as a watershed moment in the fight against ISIS and signalled the start of the end for the terror group that at its peak in 2014 controlled about one third of Syria and Iraq, murderously governing a territory almost the size of England.
“The writing was on the wall that the so called caliphate's days were numbered,” said Nathan Sales of the Atlantic Council, who served as co-ordinator for counter-terrorism and the special envoy to the global coalition to defeat ISIS under former president Donald Trump.
Mr Sales, who began that role a month after the battle of Mosul ended, said it was a time of optimism in Iraq and in the Trump administration.
“With Iraq’s second-largest city now having been liberated and in friendly hands, it was only a matter of time before the campaign ended in the total defeat of the so-called ISIS caliphate,” he told The National.
For three years, the black-and-white ISIS flag flew over Mosul, a city of more than 1.6 million people in Nineveh province, whose rich history is deeply intertwined with that of the region.
It was perhaps the clearest indication of just how serious a threat the group posed to the region and to the world.
ISIS would later destroy the structure, along with much of the Old City, during the battle of Mosul.
The fight to liberate the city took nearly a year of planning, vicious fighting and the support of dozens of countries.
The US-led military coalition, called Operation Inherent Resolve, had the task of eradicating the terror group, but was hesitant to put too many boots on the ground after the US had withdrawn its forces in 2011 at the end of the Iraq War.
“We had to come up with a way to help the Iraqis without a significant ground force,” a retired US army colonel, who worked with the operation in Baghdad at the peak of the anti-ISIS fight, told The National.
The coalition decided to focus on "the use of air power and the use of advisers to both train and retrain the Iraqi army to get them up to a level where they could take back some of the cities that they lost to ISIS".
Starting in the autumn of 2016, Iraqi forces with the help of Kurdish Peshmerga and coalition air support gradually started to take villages surrounding Mosul.
By the summer of 2017, the fight was fully in the ancient city, leading to intense urban warfare.
“It was hard work and complex,” the colonel recalled.
“It required synchronising air power, ground power, and engineering equipment to clear away rubble and to reduce obstacles.”
The job was made more difficult by the presence of civilians in the city, a concern ISIS did not share.
“It was a huge factor, ISIS was in and amongst the population,” said the retired colonel, who praised the coalition's ability to use “precise” air strikes against the enemy.
“I don't think there has ever been a more precise air campaign."
But thousands of civilians were killed or wounded in Mosul during the intense fighting that reduced much of the city to rubble. Some of these deaths were caused by US and coalition air strikes.
After more than nine months of fighting, the Iraqi army finally reclaimed the city.
It was a huge blow to ISIS, whose territorial decline increased rapidly in the following months, ending in their final loss in Baghouz, Syria, in March 2019.
The liberation of Mosul proved that the US Army and coalition forces could be successful even without their own troop there, said Maj Thomas Arnold, a US army strategist who studied the battle of Mosul.
“What we learnt is that we can keep people in the field as long as they're willing to fight," Mr Arnold said.
Mr Arnold, who spoke to The National in a personal capacity and whose views do not represent the US Army, believes that the US has carried over some of the lessons learnt in its support of the Iraqi army against ISIS to the war in Ukraine and its support of the Ukrainian military.
He said that while there was no official coalition supporting Ukraine, the US and other Nato countries stepped up to ensure Ukrainians had the tools and equipment needed to defend themselves, something the coalition forces also did for the Iraqi.
Mr Sales agreed. “The strategy of empowering motivated local partners worked very well in Iraq, worked very well in Syria. It’s working in Ukraine."
But the strategy is by no means a guarantee of success.
The Taliban last year prevailed in a 20-year conflict with western-backed Afghan security forces, who in many instances suffered from poor morale and a lack of basic weapons and provisions, as corruption swept the ranks.