"Our happiness is complete, victory has arrived and the province of Nineveh is now entirely in the hands of our forces," said a statement from the office of Prime Minister Haider al-Abadi.
It comes weeks after Iraqi forces backed by a US-led coalition ousted IS from second city Mosul, three years after the jihadists declared a self-styled "caliphate" straddling Iraq and war-torn Syria.
IS has lost much of the territory it controlled and thousands of its fighters have been killed since late 2014, when the coalition was set up to defeat the group.
IS fighters in Iraq now control only the city of Hawija, 300 kilometres north of Baghdad, and a few areas in the desert along the border with Syria.
The loss of Tal Afar, located between Mosul and the Syrian border, will deprive IS of what was once a significant hub for movement between the Syrian and Iraqi parts of the "caliphate".