“Our forces are in complete control of the Iraqi-Syrian border and I therefore announce the end of the war against Daesh (ISIS),” Mr Abadi told a conference in Baghdad.
“Our enemy wanted to kill our civilisation, but we have won through our unity and our determination. We have triumphed in little time.”
As the authorities announced a public holiday yesterday “to celebrate the victory”, Mr Abadi said in a speech that Iraq’s next battle would be to defeat the scourge of corruption.
ISIS seized vast areas north and west of Baghdad in a lightning offensive in 2014.
Iraq’s fightback was backed by an air campaign waged by a US-led coalition.
The US State Department hailed the end of the jihadists’ “vile occupation” but cautioned that the fight was not over.
“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, in Iraq is over,” State Department spokesman Heather Nauert said.
Iraq’s close ally Iran already declared victory over ISIS last month, as the jihadists clung to just a few remaining scraps of territory.
But Mr Abadi said at the time he would not follow suit until the desert on the border with Syria had been cleared.
On the Syrian side of the border, ISIS is also under massive pressure. Last Thursday, Russia’s defence ministry said its mission in support of the Syrian regime to oust IS had been “accomplished” and the country was “completely liberated”.
Despite the victory announcements, experts have warned that ISIS retains the capacity as an insurgent group to carry out high-casualty bomb attacks using sleeper cells.
Other experts warned that ISIS fighters have shifted bases to war-torn Afghanistan.