"Units from the Counter-Terrorism Service completely liberated Hit," Iraq's Joint Operations Command said in a statement.
 
CTS spokesman Sabah al-Noman said the recapture of the town west of Baghdad was completed on April 14.
 
"The town of Hit is cleared of any Daesh gunmen," Noman told AFP, using an Arabic acronym for ISIL.
 
After securing Anbar capital Ramadi, Iraqi forces launched an operation in mid-March aimed at retaking Hit, one of the largest population centres in the province still under ISIL control.
 
But the drive was apparently delayed by a two-week sit-in by supporters of powerful Shiite cleric Moqtada al-Sadr, as forces were pulled from Anbar to protect them.
 
ISIL overran large areas north and west of Baghdad in 2014, and captured Anbar capital Ramadi the following year.
 
Iraqi forces backed by U.S.-led air strikes and training have since regained signficant ground from the jihadists.
 
But ISIL still holds territory in Anbar and much of Nineveh province to its north, and it is also able to carry out frequent attacks against civilians and security forces in government-held areas.