You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
The announcement comes two days after the Russian military announced the defeat of the militants in neighbouring Syria, where Moscow is backing Syrian government forces.
Iraqi forces recaptured the last areas still under Islamic State control along the border with Syria, the military said.
"Honourable Iraqis: your land has been completely liberated. The dream of liberation is now a reality," Abadi said in a televised address. He was speaking with five Iraqi flags and dozens of servicemen from different branches behind him.
"We have accomplished a very difficult mission. Our heroes have reached the final strongholds of Daesh and purified it. The Iraqi flag flies high today over all Iraqi lands."
Daesh is an Arabic acronym for Islamic State, also known as ISIS.
Several squadrons of Iraqi helicopters flew over Baghdad carrying Iraqi flags at noon, in an apparent rehearsal for a victory parade that Iraq is planning to hold in coming days.
The government said the declaration meant Iraqi forces had secured the western desert and the entire Iraq-Syria border, and marked the end of the war against Islamic State.
Abadi declared Dec. 10 a national holiday to be celebrated every year. State television aired celebratory songs praising government forces and militias, and showed scenes of celebration on the streets of Baghdad and other provinces.
The US-led coalition that has been supporting the Iraqi forces against Islamic State welcomed the news, as did Brett McGurk, the US Special Presidential Envoy to the coalition.
"We congratulate the Prime Minister and all the Iraqi people on this significant achievement, which many thought impossible," he said in a series of tweets.
"We honor the sacrifices of the Iraqi people, its security forces, and the Kurdish Peshmerga, and admire the unity in their ranks that had made this day possible."
The US State Department also issued a statement of congratulation.
Mosul, the group's de facto capital in Iraq, fell in July after a gruelling nine-month campaign backed by a US-led coalition that saw much of the northern Iraqi city destroyed.
Islamic State's Syrian capital Raqqa also fell to a US-backed Kurdish-led coalition in September.
The forces fighting Islamic State in Iraq and Syria now expect a new phase of guerrilla warfare, a tactic the militants have already shown themselves capable of.
Abadi said Iraq had entered "the post-victory over Daesh phase" and must be prepared for future threats.
"Daesh's dream is over and we must erase all its effect and not allow terrorism to return. Despite announcing final victory, we must remain vigilant and prepared against any terrorist attempt on our country, for terrorism is an eternal enemy."
The war has had a devastating impact on the areas previously controlled by the militants. About 3.2 million people remain displaced, a UN statement said on Saturday.
Islamic State leader Abu Bakr al-Baghdadi, who in 2014 declared in Mosul the founding of a new Islamic caliphate in Iraq and Syria, released an audio recording on September 28 indicating he was alive following several reports of his death. He urged his followers to keep up the fight despite setbacks.
Baghdadi is believed to be hiding in the stretch of desert in the border area.
His followers imposed a reign of terror on the populations they controlled, alienating even many of those Sunni Muslims who had supported the group as allies against the heavy-handed rule of the Shi'ite majority-led government of the time.
The militants took thousands of women from the Yazidi minority, which lives in a mountain west of Mosul, as sex slaves and killed the men.