WASHINGTON (AFP) - The Iraqi military's hard-fought victory over the Islamic State in Iraq and Syria (ISIS) group in Mosul marks a defining moment not just for them. It is also a key win for the US doctrine behind it.
Instead of putting large numbers of American boots on the ground, the United States-led strategy in Iraq and Syria has been a non-stop air campaign combined with continual training and advising for proxy local forces.
Pentagon officials say the outcome is clear - three years after collapsing as flag-waving militants swept across their country, Iraq's security forces have become a battle-hardened army that prevailed in a brutal urban fight.
"Training works," said one senior US military officer, who was deployed to Iraq from 2015 to 2016. It "has enabled the Iraqis to take back their country". It is a far cry from when then Pentagon chief Ashton Carter said in May 2015 that the Iraqi military "showed no will to fight".
When ISIS attacked in 2014, the Iraqi security forces had grown weak under then Prime Minister Nouri al-Maliki.
Troops turned and ran, often without a fight, dumping precious US-provided weaponry and vehicles as they fled.
"It was stunning," the military official said.
"Even ISIS had to have been surprised at how rapidly the Iraqi army utterly just fell apart." The skills they had learnt under previous US tutelage from 2008 to 2011 had centred on fighting an insurgency - not stopping a fast-moving militant army.
"We needed an army that could fight conventionally," the official said.
The decision to use a few hundred US troops and other Western military experts to train local fighters stems partly from the Iraq War, which saw more than 4,400 US troops die.
A US public wary of additional deployments did not want then President Barack Obama recommitting more combat troops.
Mr Obama ordered air strikes and pursued a strategy - known in the Pentagon as "by, with and through" - to train local forces.
In the summer of 2015, coalition advisers started instructing Iraqis on conventional warfare - fighting in small units, setting up defences, how to breech minefields and so on.
By the end of that year, the Iraqis began striking back at ISIS, including with the recapture of Ramadi.
As of this month, the coalition had trained about 106,000 Iraqi security forces, including 40,000 Iraqi troops, 15,000 police, 6,000 border guards, 21,000 Kurdish peshmerga, 14,000 from the elite Counter Terrorism Service and another 9,500 "tribal mobilisation forces". The toll has been brutal, with thousands of Iraqi forces killed.
But since anti-ISIS operations began in Iraq and Syria in 2014, only 11 US troops have been killed.
The US military is trying a similar strategy with Afghan security forces in their fight against a resurgent Taleban.
For Mr Brian McKeon, a senior Pentagon policy official at the end of the Obama administration, the strategy worked, though not as quickly as had been hoped. The battle for Mosul began on October 16, 2016.
Once the decision was made to work "by with and through partners...it was the only horse that we had to ride", he said.
"It has taken longer than might have been assessed at the beginning, but that's not really unusual. No plan survives first contact and you never know where it's going to go, given the large number of variables in a war." The strategy of supporting a proxy army will become increasingly important as the US shies away from full-on deployments.
For Major John Spencer, a scholar at the Modern War Institute at West Point, the fight for Mosul has been "the biggest modern case study foreshadowing what (urban) war is going to be like in the future".
"It's kind of the ultimate end of that scale where you build an army, a police force, and a counter-terrorism force that are capable of fighting, and you send only a few hundred troops and air support to help," he said.
The US is employing the same tactic in Syria, where commandos have trained a Kurdish-Arab alliance called the Syrian Democratic Forces to tackle IS.
Pentagon chief Jim Mattis calls it the "era of frequent skirmishing", when local forces will be key in repelling non-state groups such as IS.
"We will do it by, with and through other nations," he said in a recent interview with CBS News.
Though the fight against ISIS is not over, Canadian Brigadier-General Dave Anderson, who oversees the training of local forces for the US-led coalition, said he was confident Iraqi forces would never again face a rout such as 2014.
"I had a very senior Iraqi tell me that, 'We're an ancient society and a brand new country; born in 2012, we've had a near-death experience in 2014.' That's actually a good lens through which to look at it," he said.