Fighting raged for several hours after the jails – Abu Ghraib to the west of the capital and Taji to the north – came under attack.
Mortar fire and suicide bombs were used to gain access to the jails, whose inmates include al-Qaeda prisoners.
At least 20 members of the security forces were killed as they struggled to regain control.
A senior Iraqi MP, Hakim Al-Zamili, said that about 500 prisoners had escaped from the notorious Abu Ghraib prison.
Most of them were senior members of al-Qaeda who had been sentenced to death, he told Reuters news agency.
“It’s obviously a terrorist attack carried out by al-Qaeda to free convicted terrorists with al-Qaeda,” the agency quoted an unnamed security official as saying.
Abu Ghraib was used to torture opponents of the regime during Saddam Hussein’s rule, and its infamy increased in 2004 when photographs were published showing detainees being abused by US guards.
The prison attacks were launched at about 21:30 (18:30 GMT) on Sunday night.
Gunmen fired mortar rounds at the prisons, and then used car bombs at the entrances.
The situation was eventually brought back under control on Monday morning, with the use of military helicopters.
Iraqi authorities initially denied any prisoners had escaped in the attacks, but now acknowledge “some” prisoners escaped.
Interior Minister Wissam al-Firaiji said the attackers, whom he called “terrorists,” had been well-armed.
“The attack against Taji jail alone was carried out by nine suicide bombers and three car bombs driven by suicide bombers,” he told reporters.
“The attackers also lobbed more than 100 mortar shells,” he added. “The inmates are now under control.”
Elsewhere in Iraq, two attacks on security forces in the northern city of Mosul killed 33 people, officials said.
A man drove a vehicle packed with explosives up to a military convoy.
“A suicide bomber was following the convoy and when it stopped in the middle of road he detonated his vehicle right behind it,” a policeman told Reuters news agency.
A group of soldiers and at least two passers-by were among the dead, officials said.
A second attack was launched on a group of policemen, several of whom were killed when gunmen stormed their checkpoint.
Mosul, 360km (220 miles) north-west of Baghdad, is one of Iraq’s major flashpoints.
Insurgent groups such as al-Qaeda have found the city a fertile recruiting ground.
It is the capital of the Sunni-dominated Nineveh province.
There were further deadly attacks in the city of Kirkuk and in Anbar province, according to Agence France Press.
It is unclear who was behind the incidents, but there has been a recent escalation in violence across Iraq.
United Nations figures released earlier in July showed that more than 2,500 Iraqis were killed in violent attacks in the three months from April to June.
The current spate of attacks makes this the most dangerous time in Iraq since the peak of the anti-US insurgency in 2006-7, and certainly since the US withdrawal in 2011.
Some of the country’s minority Sunni population feel increasingly marginalised by Prime Minister Nouri Maliki’s Shia-led government.
Shia forces have targeted Sunni protesters, and insurgents linked to al-Qaeda and its “Islamic State in Iraq” have been carrying out bomb attacks on government institutions and Shia population centres.
The spark in violence has raised fears of a return to the levels of sectarian killing seen following the US invasion ten years ago, and has led commentators to discuss once again the prospect of partition along community lines.
The conflict in neighbouring Syria, itself increasingly taking the form of a Sunni-Shia sectarian conflict, is further straining community relations in Iraq.
Militants have previously targeted Iraqi prisons in similar operations, though Sunday night’s breakout appears to be far larger in scale than previous incidents.
Prisons themselves have been a focus for Sunni grievances, with protesters saying inmates have been unfairly detained and in some cases tortured.
Al-Qaeda’s affiliated group in Iraq has previously said it would target the justice system, AFP reports.