Forty inmates prison break in Khalis, northeast of Baghdad, included members of Islamic State (IS).
Police said incident triggered after prisoners started fighting and when guards intervened were attacked and stripped of weapons.
Prison breaks in Iraq are usually conducted by militants to free their comrades.
In this case, interior ministry stressed there had been no external assault. A security official said to news agency the escape was planned by some prisoners.
Nine held prisoners who ran away were on terrorism charges, including members of Islamic State. The rest, officials said, were common criminals.
Grisly pictures have been circulating on social media, with some commentators suggesting a massacre took place at the prison.
The Iraqi government is facing ongoing security challenges, and is battling IS militants capturing large parts of the country.
500 inmates including Islamists have escaped from the Abu Ghraib prison west of Baghdad in 2013.