A terrifying prison break by Islamic State militants left fifty inmates and 12 police officers dead.

ISIS militants used explosives to break into the Al-Khalis facility near Baghdad, Iraq, before freeing 30 inmates and plundering the jail’s weapons stores.

After a riot erupted, dozens of prisoners escaped from the jail, which is about 50 miles northeast of Baghdad.

Shi’ite militiamen are then reported to have 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.

Authorities declared a curfew in Al-Khalis and raided houses in search of escaped convicts, said police.

"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."

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.

A car bomb in Baghdad on Saturday killed seven civilians and wounded 14 others, police and medical sources said.