BAGHDAD — Suicide attackers detonated three car bombs in quick succession near foreign embassies in Baghdad on Sunday, killing more than 40 people in coordinated strikes that Iraqi officials said were intended to disrupt efforts to form a new government.

The bombings followed the execution-style killings of 24 villagers in a Sunni area two days earlier, a spike in violence that suggests insurgents are seizing on the political uncertainty after the recent election to try to destabilize the country as U.S. troops prepare to leave.

No clear winner emerged from the March 7 vote.

Sunday’s explosions went off within minutes of each other, starting shortly after 11 a.m. One struck near the Iranian Embassy and two others hit an area that houses several diplomatic missions, including the Egyptian Consulate and the German and Spanish embassies. It was not immediately known whether diplomatic staff were among the victims.

Authorities said they foiled two other attacks aimed at diplomatic targets by stopping the would-be bombers’ vehicles and defusing the explosives.

Stunned victims in bloody clothes were loaded into ambulances as gray smoke rose over Baghdad.

“I saw children screaming,” Hassan Karim, 32, who owns a clothing shop in Baghdad, told The Associated Press. “Cars were crashing into each other in streets, trying to find a way to flee.”

There was no immediate claim of responsibility, although multiple, coordinated bombings in the capital are a hallmark of al-Qaida in Iraq.

The violence suggests insurgents are trying to regroup in the political vacuum left after the elections.

Former Prime Minister Ayad Allawi’s cross-sectarian bloc tapped into heavy Sunni support to come in just two seats ahead of the mainly Shiite list of the incumbent, Prime Minister Nouri al-Maliki.

But neither side has enough seats to govern alone.

Iraq’s Ministry of Foreign Affairs said the bombings were an attempt to inject more turmoil into the political scene as the election front-runners try to forge a coalition government.

“These terrorists will not be able to stop Iraqis and friends of the Iraqi people from building a free, secure and prosperous future,” the ministry said.

Several Iraqi guards from the German and Egyptian missions were confirmed dead, authorities said. One police official said many of the victims were employees at a state-run bank near the Iranian Embassy. He spoke on condition of anonymity because he was not authorized to speak publicly.

The Spanish embassy building suffered “considerable damage” but nobody was injured, the Spanish government said.

The attackers wore suicide vests and drove cars laden with explosives, said Maj. Gen. Qassim al-Moussawi, a spokesman for the city’s operations command center. Guards at the Egyptian Consulate opened fire on one of the attackers as he drove toward them, but they were unable to stop him.

At least two other planned attacks were thwarted.

Security forces fatally shot a man wearing a suicide belt before he could detonate a fourth bomb-rigged car near the former Germany Embassy, which is now a bank, al-Moussawi said. A fifth would-be bomber was captured on his way to the area where two of the explosions happened, said a senior Iraqi security official. He spoke on condition of anonymity because of the sensitivity of the matter.

The official said Iraqi forces were tipped off about a possible attack against diplomatic targets and had started beefing up security Saturday, which he credited with keeping the embassies from serious damage.

“We were fortunate they weren’t able to reach their targets,” the official said.

While overall violence has dropped considerably in Iraq since 2006 and 2007, the ability of insurgents to carry out well-planned attacks against prominent targets shows that significant security lapses remain.