Fifty inmates and 12 police died in a prison escape organised by Islamic State, Iraqi officials said on Saturday, while supporters of the group acknowledged it staged the breakout but gave different details.
After a riot erupted, dozens of prisoners escaped from the Al-Khalis facility, about 80 km northeast of Baghdad, security and police officials said.
Militants of Islamic State, the group sometimes known as ISIS which has seized large areas of Iraq and Syria, broke in with the help of explosives to free 30 inmates and get into the jail's weapons stores, said Amaq News Agency, which supports the group.
The agency said Shi'ite militiamen then stormed the prison and killed about 60 militants in clashes.
"ISIS was responsible for the killings and the release of ISIS prisoners," said Oudi Al-Khadran, mayor of the town where the prison, which holds hundreds of people convicted of terrorism, is located.
That account was confirmed by Colonel Ahmed al-Timimi of the Diyala province security operations centre.
It was not clear if any high-profile prisoners were held at Al-Khalis, said the head of Diyala's security committee, Seyyid Sadiq al-Husseini.
"The inmates started fighting among themselves, which drew the attention of the police guards who went to break up the fight," said a police source, asking not to be named.
"Then the prisoners attacked them, stripped them of their weapons and started a riot while also managing to capture the armory of the prison."
Authorities declared a curfew in Al-Khalis and raided houses in search of escaped convicts, said another police source.
The Iraqi government, which is backed by U.S. air strikes in its campaign against Islamic State, is also trying to contain widespread sectarian violence.
Meanwhile, a car bomb in Baghdad on Saturday killed seven civilians and wounded 14 others, police and medical sources said.