Both attacks took place around 8 a.m. in southeast Baghdad, about four miles apart. They came as Shiites marked the first day of Eid, a three-day celebration that follows Ramadan, Islam's holy month.

Death tolls in both attacks will probably rise, officials said.

A suicide bomber strapped with explosives killed at least 12 worshippers and injured 25 as they left al Razool mosque in Jadida, a largely Shiite district, police said. Officials described the bomber as a teenage male who detonated himself as guards were searching him near the gates of the mosque.

Never miss a local story.

Sign up today for unlimited digital access to our website, apps, the digital newspaper and more.

Bystanders were told not to help the wounded, said Mohammed Abu Mustafa, 45, who witnessed the blast. "The guards were shouting at people not to get close to the area because they feared there would be another explosion," he said. "They were firing their guns in the air to keep people away."

Secondary explosions aimed at killing responders are common in Iraq.

"I saw many people bleeding and so much broken glass," Mustafa said. "Some of the injured were being taken away in taxi cabs." Around the same time, at least eight more people were killed and 10 injured in an attack in Zafaraniya. A suicide bomber driving a Mercedes packed with explosives is to blame, police said.

The bomber was trying to strike a Shiite mosque, officials said, but instead collided with an Iraqi Army vehicle parked in front of the mosque to protect worshippers. Both vehicles exploded.

Police said four Iraqi soldiers are among the dead.

"Because the explosions were at the same time, it's probable they were coordinated," a police official said.

A U.S. military spokesman confirmed both attacks but gave lower death tolls. A total of eight people are thought to have been killed, said Navy Lt. Cmdr. David Russell.

Also on Thursday morning, five people were killed and two were injured when gunmen in a speeding car opened fire on a Kia minibus driving in al Wijiahiya, east of Baqouba in Diyala province, Iraqi Army officials said. Three women and two children were among the dead. The minibus driver and another woman were injured.

Diyala remains one of the most dangerous Iraqi provinces despite a recent military crackdown there.

Jalal al Din al Saghir, a prominent Shiite member of Iraq's parliament, condemned the attacks and said they bore the hallmarks of al Qaida in Iraq.

Authorities feared that terrorists might use violence to mar Eid, the most celebrated Muslim holiday. Eid is a three-day holiday during which Muslims eat, give gifts and visit with family and neighbors. It follows Ramadan, Islam's holy month, when Muslims fast from dawn to dusk.

Ramadan ended Tuesday for Sunni Muslims in Iraq and Thursday for the country's Shiite majority.