BAGHDAD — Multiple explosions rocked Baghdad on Wednesday, killing at least 34 people and sending plumes of smoke into the sky across the street from a major government building in a brazen reminder of the ability of insurgents to penetrate the heart of the capital.
The attacks come as militants led by Al Qaeda are battling for control of Sunni areas to the west in the first test of the Shi’ite-led government’s ability to maintain security in the country more than two years after the withdrawal of US troops.
The deadliest of Wednesday’s attacks took place across the street from the high-rise building housing the Foreign Ministry, shattering the windows of nearby apartment buildings. Two parked car bombs went off simultaneously in different parking lots, killing at least 12 people, including three police officers, and wounding 22, an officer said.
Shortly afterward, a suicide bomber blew himself up in a nearby falafel restaurant frequented by officials and visitors waiting for security escorts to take them inside the green zone, a walled-off area that houses the prime minister’s office and the US embassy.
Five people were killed and 12 wounded in that attack, the officer said.
All the roads leading to the blast sites place were sealed off by police as workers cleared debris and washed bloodstains from the sidewalks.
Another car bomb exploded in Khilani Square, a busy commercial area in central Baghdad, killing five people and wounding 11, police said. Security forces sealed off the area as firefighters struggled to put out the blaze ignited by the bombing. Smoke billowed from several stores and stalls as vendors stuffed their goods into bags and carried them away.
Shortly before sunset, a triple car bombing struck an outdoor market in the mainly Shi’ite suburb of Jisr Diyala in southeastern Baghdad, killing nine people and wounding 24. Minutes later, a rocket landed near the western gate of the green zone, killing one passerby and wounding seven others, police said.
Nobody claimed responsibility for the attacks, but car bombings and suicide attacks targeting government buildings, security forces, and Shi’ites are typically carried out by Al Qaeda’s affiliate in Iraq, the Islamic State of Iraq and the Levant.
A bomb went off later inside a cafe in the mainly Sunni neighborhood of Dora, killing two people and wounding six, officials said. It was unclear who was responsible for that attack. Sunni insurgents frequently target rivals within the community who have allied with the government. Shi’ite extremists also sometimes plant bombs in Sunni areas, raising fears of a new wave of retaliatory violence of the kind that pushed the country to the brink of civil war in the years following the 2003 US-led invasion that toppled Saddam Hussein.
Medical officials confirmed the casualty figures. All officials spoke on condition of anonymity because they were not authorized to speak with the media.
Interior Ministry spokesman Saad Maan Ibrahim said the recent attacks in Baghdad represent ‘‘a futile reaction by the terrorist groups toward the defeats they are suffering at the hands of the security forces in the western Anbar province.’’
Since late December, militants have taken over parts of the Anbar provincial capital of Ramadi and the center of nearby Fallujah, prompting a standoff with government soldiers.
More than 200 militants have been killed in airstrikes and clashes with soldiers since the government and allied tribes launched an offensive to wrest control of the cities in Anbar province on Jan. 26, the Iraqi Defense Ministry said.
In Washington, Brett McGurk, deputy assistant secretary for Iraq and Iran, told the House Foreign Affairs Committee that the Iraqi government’s efforts to support tribal leaders fighting the Islamic State of Iraq and the Levant in Ramadi were succeeding.
‘‘In recent weeks, we have seen a new level of commitment from the government of Iraq to mobilize the local population against ISIL,’’ McGurk said.