Iraqi Prime Minister Haider al-Abadi said on Tuesday Islamic State group had been defeated from a military perspective but he would only declare final victory after IS group militants were routed in the desert.
Iraqi forces on Friday captured the border town of Rawa, the last remaining town under Islamic State group control, signalling the collapse of the group's "caliphate" proclaimed after it overran much of Iraq's north and west in 2014.
Securing desert and border areas is what remains in the campaign against Islamic State group, military commanders say.
Abadi's comments came as Iranian President Hassan Rouhani declared the end of Islamic State group while a senior Iranian military commander thanked the "thousands of martyrs" killed in operations organised by Iran to defeat the militant group in Syria and Iraq.
Political disagreements will pave the way for the Sunni militant group to carry out attacks, however, Abadi said. He was referring to the central Baghdad government's dispute with the semi-autonomous Kurdistan Regional Government over the latter's declaration of independence following a Sept. 25 referendum.
Hours before Abadi spoke, at least 23 people were killed and 60 wounded when a suicide bomber set off a truck bomb near a crowded marketplace in the northern Iraqi town of Tuz Khurmatu, south of the oil city of Kirkuk.
Abadi, addressing a weekly news conference, hailed a federal court verdict that ruled the Kurdish referendum unconstitutional and called on Kurds not to resort to violence.
Iraq's Supreme Federal Court ruled on Monday that the referendum was unconstitutional and the results void, bolstering Baghdad's hand in a stand-off with the Kurdish region watched closely by neighbouring Turkey and Iran.
Kurds voted overwhelmingly to break away from Iraq in the referendum, defying Baghdad and alarming neighbouring Turkey and Iran who have their own Kurdish minorities.
The Iraqi government responded to the referendum by seizing Kurdish-held Kirkuk and other territory disputed between the Kurds and the central government. It also banned direct flights to Kurdistan and demanded control over border crossings.