Bombings in Baghdad and northeast of the capital killed at least 32 people Monday, Iraqi officials said, the latest in an apparent bid by insurgents to chip away at growing public confidence in recent security gains.

At least 20 were killed and 30 were wounded in a suicide bombing in an evening attack in Balad Ruz, 45 miles northeast of Baghdad, said Maj. Gen. Abdul-Karim al-Rubaie, the military commander of operations in Diyala province. Many of the dead were police.

A police officer said the attacker was a woman. The officer spoke on condition of anonymity because he is not authorized to speak to the media.

Another security official said the bomber targeted the house of a former police commissioner who had been detained in Camp Bucca, a U.S.-run prison, for one year and was released Monday. At the time of the explosion, the detainee was hosting relatives and friends at a banquet.

Earlier Monday, a double car bombing struck a busy commercial district in Baghdad, killing at least 12 people in one of the deadliest attacks in the capital in weeks.

Iraqi officials said the explosives-laden cars were parked between a passport office and a courthouse when they blew up nearly simultaneously in the mainly Shiite neighborhood of Karradah.

Authorities lifted a ban on parking vehicles in the area about three months ago, although the buildings remained surrounded by concrete walls for protection against bombings.

Police and an official at the nearby Ibn al-Nafis hospital said the 12 killed were all civilians. The officials, who spoke on condition of anonymity because they were not authorized to release the information, also said 36 people were wounded and dozens of cars were burned or damaged.

Officials said the bulk of the damage occurred from the car bomb that exploded on a median near the passport office. The other blast occurred at a restaurant near the courthouse. The cars were about 100 yards apart.

The blasts came as Defense Secretary Robert Gates arrived in Baghdad to meet with Iraqi officials and preside over Tuesday's handover ceremony to mark the transition of command of U.S. forces in Iraq.

American commanders have warned security gains remain fragile and need to be supported by progress on the political front.

Much of the recent violence has occurred in northern Iraq.

Monday's attack in Baghdad was the deadliest in the Iraqi capital since Aug. 3, when 12 people also were killed by a truck bomb that exploded in the mainly Sunni neighborhood of Azamiyah. That explosion also occurred outside a heavily barricaded passport office.