"Our forces are in complete control of the Iraqi-Syrian border and I therefore announce the end of the war against Daesh (IS)," 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," he said.
IS seized vast areas north and west of Baghdad in a lightning offensive in 2014.
With Iraq's army and police retreating in disarray at the time, Ayatollah Ali Sistani, spiritual leader of the country's majority Shiites, called for a general mobilisation, leading to the formation of Hashed al-Shaabi paramilitary units.
Also Read
"I announce the good news: the liberation by Iraqi forces of the whole of the Iraqi-Syrian border," the prime minister told the conference organised by the Iraqi journalists' union.
Iraq's close ally Iran already declared victory over IS last month, as the jihadists clung to just a few remaining scraps of territory.
But Abadi said at the time that he would not follow suit until the desert on the border with Syria had been cleared.
On the Syrian side of the border, IS is under massive pressure too.
On Thursday, Russia's defence ministry said its mission in support of the Syrian regime to oust IS jihadists had been "accomplished" and the country was "completely liberated".
In the border region, pro-government forces and US-backed Kurdish-led forces are conducting operations to clear IS fighters from the countryside north of the Euphrates valley after ousting them from all Syrian towns.
Federal forces "now control the border with Syria from Al-Walid border crossing to that of Rabia", covering a distance of 435 kilometres (270 miles), he said.
Despite the victory announcements, experts have warned that IS retains the capacity as an insurgency group to carry out high-casualty bomb attacks through sleeper cells.
The fightback in Iraq kicked off with the "liberation" of Tikrit, north of Baghdad, that had been under IS control for nearly 10 months.
The operations have involved both Tehran, through Iranian-trained Shiite militias in the Hashed al-Shaabi coalition, and Washington as head of the anti-jihadist coalition.
The western cities of Ramadi and Fallujah followed in 2016 before the turning point of the recapture of Iraq's second city of Mosul in July this year after a nine-month offensive led by a 30,000-strong federal force.
Victory was declared at the end of August in Tal Afar, the last major IS urban stronghold in northern Iraq, before a final military operation launched last month against IS in a vast desert region of western Iraq.
Disclaimer: No Business Standard Journalist was involved in creation of this content