Image copyright AFP Image caption Recapturing Mosul was the bloodiest conflict - for both combatants and civilians

Iraq has announced that its war against so-called Islamic State (IS) is over.

Prime Minister Haider al-Abadi told a conference in Baghdad that Iraqi troops were now in complete control of the Iraqi-Syrian border.

The border zone contained the last few areas IS held, following its loss of the town of Rawa in November.

The US state department welcomed the end of the "vile occupation" of IS in Iraq and said the fight against the group would continue.

Iraq's announcement comes two days after the Russian military declared it had accomplished its mission of defeating IS in neighbouring Syria.

The jihadist group had seized large swathes of Syria and Iraq in 2014, when it proclaimed a "caliphate" and imposed its rule over some 10 million people.

But it suffered a series of defeats over the past two years, losing Iraq's second city of Mosul this July and its de facto capital of Raqqa in northern Syria last month.

Some IS fighters are reported to have dispersed into the Syrian countryside, while others are believed to have escaped across the Turkish border.

A battle unfinished

By Sebastian Usher, BBC Arab affairs editor

This is undeniably a proud moment for Mr Abadi - a victory that once looked like it might only ever be rhetorical rather than real.

But if the direct military war with IS in Iraq is genuinely over, and the country's elite forces can now step back after a conflict that's taken a huge toll on them, it doesn't mean the battle against the group's ideology or its ability to stage an insurgency is finished - whether in Iraq, Syria or the wider world.

Attacks may be at a lower level than they once were, but Iraqi towns and cities still fall prey to suicide bombers, while the conditions that fuelled the growth of jihadism remain - even in the territory that's been recaptured.

Mr Abadi said on Saturday: "Our forces are in complete control of the Iraqi-Syrian border and I therefore announce the end of the war against Daesh [IS].

"Our enemy wanted to kill our civilisation, but we have won through our unity and our determination. We have triumphed in little time."

The Iraqi armed forces issued a statement saying Iraq had been "totally liberated" from IS.

US state department spokeswoman Heather Nauert said in a statement that Iraqis who had lived under the jihadists' "brutal control" were now free.

"The United States joins the government of Iraq in stressing that Iraq's liberation does not mean the fight against terrorism, and even against Isis [IS], in Iraq is over," she added.

UK Prime Minister Theresa May congratulated Mr Abadi on a "historic moment" but warned that IS still posed a threat, including from across the border in Syria.

Last month, the Syrian military said it had "fully liberated" the eastern border town of Albu Kamal, the last last urban stronghold of IS in that country.

On Thursday, the head of the Russian general staff's operations, Col-Gen Sergei Rudskoi, said: "The mission to defeat bandit units of the Islamic State terrorist organisation on the territory of Syria, carried out by the armed forces of the Russian Federation, has been accomplished."

Image copyright Reuters Image caption Estimates of civilian deaths in Mosul alone vary wildly, with one figure as high as 40,000

He said Russia's military presence in Syria would now concentrate on preserving ceasefires and restoring peace.

The collapse of IS has raised fears that its foreign fighters will escape over Syria's borders to carry out more attacks abroad.

Iraq's war with IS

Image copyright Reuters Image caption Civilians flee as Iraqi forces battle to retake Mosul in March 2017