BAGHDAD — A wave of apparently coordinated bombings hit bakeries and public markets in Baghdad on Wednesday, killing at least 42 people and wounding more than 90, many of them as they rushed to shop during a break in heavy rainstorms, according to the police, residents and medical officials.

The attacks, most of them car bombings, targeted Shiites and Sunnis, reflecting the protracted sectarian violence that has spiked since the American withdrawal in 2011 and raising concerns that Iraq is facing levels of strife not seen for years.

One attack struck Shiite Muslims during religious observances for Muharram, the first month of the Islamic calendar, as they prepared food for the poor, witnesses said. That bombing, in the Karada neighborhood, killed seven people and wounded 19, the police said.

Another bomb erupted near a bakery where people were buying bread for breakfast, killing five and wounding 13, officials said. In Adhamiya, a mostly Sunni neighborhood in northern Baghdad, a bomb in a parked car exploded near another bakery, killing three people.