The deaths occurred inside Al-Khalis prison northeast of Baghdad during a riot and on a manhunt for escaped convicts overnight, they said.
Later The spokesman for State ministry said the break on Friday started when an inmate took a weapon from a warden at the prison on the main police compound in Khalis, a town around 50 kilometres (30 miles) north of Baghdad.
"One of the prisoners seized a weapon from a guard. After killing him, the inmate headed up to the weapons storage and he seized more weapons," Brigadier General Saad Maan told AFP.
"Clashes erupted inside. We lost a first lieutenant and five policemen, forty prisoners fled. Nine of them were held on terror charges and the rest for common crimes," he said.
Maan added that 30 prisoners who had been held on terrorism charges were killed in the clashes.