Twin car bombs hit central Baghdad on Tuesday (local time), killing at least 19 people, and security forces fought off a separate attack inside a police station by two suicide bombers trying to free al Qaeda prisoners.
The major assault underscored the seriousness of Iraq's struggle with insurgents more than seven months after the last US troops left behind a country still grappling with political instability and sectarian tensions.
Clouds of dark smoke rose above the centre of the capital where the car bombs exploded minutes apart, leaving the dead and wounded lying in the street or slumped inside a damaged minibus, witnesses and police said.
As security forces began to help the victims, at least two suicide bombers dressed as police officers got into a nearby police station, where al Qaeda prisoners were being held, and tried to free them, two security sources said.
It was unclear how many people had been killed or wounded in the assault, but both bombers had been killed, one security official said.
"Their aim was to take hostages in order to release major al-Qaeda prisoners," one senior security source said. "Most officers went to the floor above them to fight them, which is why they failed."
The attack coincides with a surge in violence in Iraq and comes as bloodshed in neighbouring Syria is escalating. Iraqi officials have warned that some Sunni Muslim insurgents are heading to Syria and al Qaeda's local Iraqi affiliate has called on its followers to intensify their campaign.
Al Qaeda's Iraqi wing, Islamic State of Iraq, was badly weakened by the loss of top commanders in the war against US troops, but the insurgents have carried out at least one major assault a month since the U.S. withdrawal in December.
Three young men in blood-stained T-shirts searched for a friend near the wreckage of one of Tuesday's car bomb blasts in Baghdad as women in traditional abaya gowns screamed the name of a missing relative, a Reuters reporter at the scene said.
"We were in a patrol when we heard the first explosion. The second explosion hit another square, and we went to help ... There was a minibus with six dead passengers inside it," said Ahmed Hassan, a police officer.
The explosions followed attacks and bombings in Baghdad and across the country on July 23 that killed more than 100 people in a coordinated surge of violence against mostly Shi'ite Muslim targets. Islamic State of Iraq claimed responsibility.
Overall levels of violence have eased since sectarian killings reached their height in 2006-2007 when tens of thousands of Sunnis and Shi'ites were slain.
However, Al Qaeda still often targets Shi'ite pilgrims or religious sites in an attempt to stir up sectarian tensions and to show that Iraq's armed forces are unable to protect civilians.
Last month was one of the bloodiest since the US withdrawal, with at least 237 people killed and 603 wounded.
Iraq's violence often feeds into political tensions.
Prime Minister Nuri al-Maliki, a Shi'ite, is fending off attempts by Sunni and Kurdish rivals to vote him out of office, threatening to scuttle a fragile power-sharing agreement.