Tal Afar lies on the supply route between Syria and the former Islamic State stronghold of Mosul, 80 km (50 miles) to the east.
The elite Counter Terrorism Service “liberated the citadel neighborhood .. and raised the Iraqi flag on top of the citadel building,” a statement from the Iraqi joint operations command said.
Much of the Ottoman-era citadel itself was destroyed by the militants at the end of 2014.
The city has produced some of the militant group’s most senior commanders. It experienced cycles of sectarian violence between Sunnis and Shi’ites after the U.S.-led invasion of Iraq in 2003.
Tal Afar, which had a pre-war population of about 200,000, is the latest objective in the U.S.-backed war on Islamic State following the recapture of Mosul after a nine-month campaign that left much of the city, the biggest in northern Iraq, in ruins.
The fall of Mosul in effect marked the end of the self-proclaimed “caliphate” Islamic State declared over parts of Syria and Iraq in 2014. Tal Afar was cut off from the rest of IS-held territory in June.
The number of civilians believed to have remained in the city at the start of the offensive was estimated at between 10,000 and 20,000 by the U.S. military.
As in the battle for Mosul, civilians are suffering badly.
Waves of residents fled the city in the weeks before the battle started. Those remaining were threatened with death by the militants, who held had a tight grip there since 2014, according to aid organizations and residents who managed to flee.
On Tuesday, the U.N. refugee agency UNHCR said those who had fled were suffering from dehydration and exhaustion, having lived on bread and dirty water for three to four months.
People were arriving at camps for displaced people with wounds from sniper fire and mine explosions.
(Writing by Maher Chmaytelli; Editing by Andrew Bolton)