Only weeks after a military medic was killed in a rocket attack by an Iranian-backed group, Britain's army said it was pulling out its remaining troops from Camp Taji north of Baghdad.
The UK government said a six year mission to train the Iraqi security forces had come to an end and the last troops had left the sprawling facility that has been at the heart of the struggle for the country over the past two decades.
The Nato-led training mission for the Iraqi Security Forces is to continue at the Taji base, about 15 kilometres north of Baghdad, with Danish troops to lead efforts to teach and advise Iraqi security forces from December.
UK officials said about 100 troops would remain in Iraq in various locations and Britain's air force and drone deployments would continue to play a central role in the coalition to defeat ISIS. The figure is a reduction from about 400 troops in March, when the last British soldier to die in the country was killed at Taji.
"The British army are handing over Camp Taji but are by no means leaving Iraq," a statement said.
The barrage of Katyusha rockets in March killed L/Cpl Brodie Gillon, a reservist attached to the mission. The 26-year-old was described as a "larger than life soldier" who was "destined for great things" by commanding officers.
At the time of the 2003 invasion to oust Saddam Hussein British forces provided the second biggest troop presence in Iraq. The UK's current deployment is now a fraction of that of the US, which has about 5,000 troops.
The Army said British troops were in the country to provide training and equipment to Iraqi and Kurdish security forces – rather than in a combat role – and have trained more than 120,000 Iraqi forces.
The British statement said the mission had helped Iraqi partners develop the capacity to carry out their own training.
"Ranges, identifying improvised explosive devices, and lessons on patrolling skills were all on the training programme for the Iraqi soldiers, but arguably the British soldiers’ biggest contribution was the gift of training the trainers," the statement said.
It added that the threat from ISIS remained.