The security breach drew sharp criticism of Iraqi security forces, which have been unable to stabilize the country almost a year after U.S. troops withdrew. Officials said that reinforcements had to be sent from Baghdad to help put down the riot and prisoners burned all the prison records, complicating efforts to track down those still on the run.

The riot erupted on Thursday night when several inmates at the Tasfirat prison in Tikrit, 130 kilometers (80 miles) north of Baghdad, broke into a storage room, grabbed weapons being kept there and overpowered the guards, according to a spokesman for Salahuddin province where the city is located.

The prisoners then exchanged gunfire with security troops inside the facility before breaking out hours later. By Friday morning, government troops had regained control of the prison, the spokesman Mohammed al-Assi said.

"Everything is under control now. Our security forces are chasing the escaped prisoners and have already recaptured some," al-Assi said in a telephone interview.

Iraq has been struggling to keep terror suspects behind bars since U.S. forces turned over legal custody of their detainees to the government. In July 2011, detainees linked to al-Qaida escaped at least twice from a Baghdad area prison known as Camp Cropper shortly after the U.S. handed it over to Iraqi authorities.

The jailbreaks have deeply embarrassed Iraq's government, which is eager to demonstrate it can control its justice system.

A provincial health official, Raed Ibrahim, confirmed that 12 people died in the violence -- 10 prison guards and two inmates. He said 32 people were wounded in the clashes at the prison.

Qutaiba al-Jubouri, a lawmaker from the province, said 81 inmates, including some who were on death row, managed to escape but 36 had been recaptured. He said the prison warden Lt. Col. Laith al-Sagmani was wounded during the clashes and inmates slit the throat of a police captain.

"This is a regrettable security breach," said al-Jubouri, adding that an investigation will follow, "starting with the commanders of the security forces" at the prison.

He added that special forces were sent to Tikrit from Baghdad in order to put down the rioting. Security forces later dismantled three car bombs that were found parked near the prison.

Prisoners seized police uniform inside the prison during the riots and they wore the uniform as a kind of deception in order to mislead the security forces, according to two provincial security officials.

Another lawmaker, Hakim al-Zamili, said the inmates burned all the prison records during the rioting, suggesting the jailbreak was an inside job.

"This incident shows that Iraqi security troops are still unable to control the situation and that they are still being infiltrated by terrorists," al-Zamili said.

He blamed delays in implementing the death sentences and the soft treatment in the country's prison for the jailbreaks, adding that "the death sentences should be implemented on the terrorists as soon as possible instead of letting them plan for attacks or escape from their cells."

Prison escapes have frequently occurred in Iraq.

The Tikrit prison itself was moved to a different location after 16 prisoners, including five al-Qaida-linked inmates awaiting execution, made their escape after plying open the bars on a prison bathroom window with a pipe wrench in September 2009.

At the time, the entire prison staff and the provincial prison official were detained for questioning. Six of the escaped inmates were later captured.

In 2010, a dozen detainees held on terrorism charges broke out of a prison in the southern city of Basra, disguised in police uniforms. And last year, al-Qaida smuggled weapons and grenades into a prison in Mosul, supposedly one of the country's most secure detention centers, and attempted an ultimately unsuccessful jailbreak that left 17 dead.

In other violence Friday, gunmen shot dead the former governor of Basra, Mohammed al-Wailie, as he was driving his car in the center of the southern city, the police said. Hundreds of people, including senior Basra officials, participated in al-Wailie's funeral.

In the oil-rich city of Kirkuk, gunmen shot dead Sunni cleric, Mohammed Hussein as he was leaving the mosque after ending night prayers, according to Kirkuk police commander Brig. Gen. Sarhad Qadir.