Iraqi security forces locked down areas around the infamous Abu Ghraib prison and another high-security detention facility on Baghdad’s outskirts Monday to hunt for escaped inmates and militants after daring insurgent assaults set hundreds of detainees free.

The carefully orchestrated late-night attacks killed dozens Sunday, including at least 25 members of the Iraqi security forces. Insurgents fired dozens of mortar shells and detonated suicide and car bombs, drawing Iraqi forces into firefights that lasted more than an hour.

Attacks elsewhere Monday claimed at least 18 more livesy, many of them soldiers, highlighting the rapidly deteriorating security conditions across Iraq.

The prisons in Abu Ghraib and Taji house thousands of prisoners, including convicted al-Qaida militants. Exactly one year ago, al-Qaida’s Iraq arm launched a campaign called “Breaking the Walls” that made freeing its imprisoned members a top priority.

A surge of violence across Iraq has killed more than 3,000 people since the start of April, and the assaults on the prisons laid bare the degree to which security has eroded in the country in recent months. The spike in bloodshed is intensifying fears of a return to the widespread sectarian killing that pushed the country to the brink of civil war after the 2003 U.S.-led invasion.

Several officials, including lawmakers on parliament’s security and defense committee, said more than 500 inmates managed to escape from Abu Ghraib. There were no immediate reports of escapes from Taji.

Authorities imposed curfews around both prisons as manhunts got underway. Guards at Taji appeared visibly on edge Monday, with rifles at the ready and wary police warning motorists not to idle even briefly nearby.

“This big security failure shows that the top security commanders have failed to sort out any solutions for the ongoing security deterioration,” said Shawan Mohammed Taha, one of the lawmakers who confirmed the escapes. “The terrorists, not the security forces, are now taking the initiative.”

Another lawmaker, Hakim al-Zamili, said many of the escaped inmates had been captured or killed by Monday afternoon. He said authorities believe the attack on Taji was a distraction, and that Abu Ghraib was the main target.

So many prisoners were able to get away from Abu Ghraib because they were in the prison yard for the communal iftar meal that ends the daylong fast during the Islamic holy month of Ramadan, a senior intelligence official and two other government officials said.

The officials also confirmed the number of escaped inmates and said an investigation has been launched into who ordered the open-air Ramadan feast. They spoke on condition of anonymity because they were not authorized to discuss the investigation.

A preliminary investigation suggests the insurgents had inside help, the Interior Ministry said.

Police reported 15 soldiers and 13 others wounded in the Taji attack, along with six militants. Ten policemen were killed and 19 others were wounded in Abu Ghraib, along with four militants, according to police and hospital officials, who all spoke on condition of anonymity.

A total of 21 prisoners were killed and 25 wounded during the attacks, according to Justice Ministry spokesman Wissam al-Firaiji.

The U.S. military previously operated the lock-ups in Taji and Abu Ghraib but handed control of both facilities back to Iraqi authorities before the last American troops departed in December 2011.