Iraqi PM visits Mosul to celebrate "victory" over ISIS
Abadi's office said the city was "liberated," save "one or two pockets" still being ISIS control.
The victory in Mosul, ISIS' de-facto capital city, comes after nearly nine months of deadly urban warfare.
Iraqi forces have been backed by US-led coalition airstrikes.
Battle for Mosul
Victory to be formally declared once ISIS fully cleared out
Abadi visited Mosul to "congratulate the armed forces and the Iraqi people" on the defeat of IS, a statement said.
"Victory is certain, and what remains of [ISIS] is surrounded," it added.
Abadi hasn't formally announced the victory at Mosul. His office said this will be declared once ISIS is cleared out from all remaining pockets of the city.
Mosul devastated, stench of decaying corpses everywhere
The BBC's Jonathan Beale reported that Iraqi troops were assisting civilians with "haunted" faces flee the city.
Beale said: "If this is victory it's come at a huge cost… Nearly everyone rescued had had to leave dead relatives behind."
He reported that nearly every building in Mosul's historic Old City has been destroyed or scarred.
He reported a continued stench of decaying corpses.
Love World news?
Stay updated with the latest happenings.
Mosul an important ISIS stronghold, defeat represents huge setback
It was the biggest city to fall under ISIS control and also where leader Abu Bakr al-Baghdadi announced his caliphate in 2014.
In January, the Iraqi government had announced the "liberation" of eastern Mosul.
The western part of the city, including the Old City, which features narrow, winding streets has presented a difficult tactical challenge for Iraqi forces.
Nearly half of city's population displaced by fighting
An estimated 900,000 residents of Mosul, nearly half the city's pre-ISIS occupation population, have been displaced from the fighting, according to aid groups. Thousands of civilians, including women and children, have died in the battle of Mosul.