People gather at the scene of a bomb attack Saturday in the neighborhood of Bawiya in eastern Baghdad, Iraq. A bombing near a playground and other insurgent attacks killed 18 people including several children in Iraq on Saturday, police said. (ASSOCIATED PRESS / Khalid Mohammed)

BAGHDAD (AP) — Iraqi insurgents unleashed a string of bombings and other attacks primarily targeting the country’s Shiite community on Saturday, leaving at least 40 dead in a challenge to government efforts to promote a sense of stability by preventing attacks during a major Muslim holiday.

The bloodshed appeared to be the worst in Iraq since Sept. 9, when insurgents launched a wave of bombings and other attacks that left at least 92 dead in one of the country’s bloodiest days this year.

The attacks underscored the difficulties facing the country’s leadership as it struggles to keep its citizens safe. Authorities had increased security in hopes of preventing attacks during the four-day Eid al-Adha celebrations, when people are off work and families gather in public places.

The deadliest attacks struck in the evening in the Shiite neighborhood of Sadr City. Police said a car packed with explosives blew up near a market, killing 12 people and wounding 27. Half an hour later, a second car bomb went off in one of Sadr city’s bus stations, killing 10 and injuring 31.

Earlier in the day, a bomb exploded near playground equipment that had been set up for the holiday in a market on the capital’s outskirts in the eastern neighborhood of Bawiya. Police officials said eight people were killed, including four children. Another 24 people, including children, were wounded, they added.

“Nobody expected this explosion because our neighborhood has been living in peace, away from the violence hitting the rest of the capital,” said Bassem Mohammed, a 35-year-old father of three in the neighborhood who was startled by the blast.

“We feel sad for the children who thought that they would spend a happy time during Eid, but instead ended up getting killed or hurt.”

Elsewhere, a bomb attached to a bus carrying Iranian Shiite pilgrims killed five people and wounded nine, according to police. The bomb, hidden on the underside of the bus, detonated as the pilgrims were heading to a Shiite shrine in Baghdad to mark the holiday.

Authorities have said they planned to increase the number of checkpoints, shut some roads and deploy extra personnel during the holiday period.

They are also relying more on undercover intelligence agents, said Lt. Col. Saad Maan Ibrahim, a spokesman for the interior ministry. He emphasized that both bombings took place on the edge of the capital rather than in densely populated areas.

“The terrorists apparently weren’t able to get to the heart of the city. So they chose to attack soft targets on the outskirts,” he said.

In the northern city of Mosul, gunmen broke into the houses of two Shabak families, killing a boy and his parents in one and a mother and daughter in the other, according to police. A bomb exploded near the house of another Shabak family, wounding six family members.

Shabaks are ethnically Turkomen and Shiite by religion. Most Shabaks were driven out of Mosul by Sunni militants during the sectarian fighting a few years ago.

In Tuz Khormato, about 210 kilometers (130 miles) north of Baghdad, a car bomb exploded near in a neighborhood with a Turkomen Shiite majority. Mayor Shalal Abdoul said 11 people were wounded, including three children.

Medics in nearby hospitals confirmed the casualties. All officials spoke on condition of anonymity because they were not authorized to talk to the media.

Eid al-Adha, or Feast of the Sacrifice, is a major Muslim holiday that commemorates what Muslims believe was the Prophet Abraham’s willingness to sacrifice his son Ismail, the Biblical Ishmael, as a test of his faith from God. Christians and Jews believe another of Abraham’s sons, Isaac, was the one almost sacrificed.

The holiday, which began Friday, marks the end of the hajj pilgrimage to Mecca. Muslims worldwide typically slaughter lambs and other animals to commemorate the holiday, sharing some of the meat with the poor.

Violence has ebbed across Iraq, but insurgents frequently attack security forces and civilians in an attempt to undermine the country’s Shiite-led government.

Holidays are a particular time of concern for security forces. A wave of attacks shortly before another Muslim holiday in August, Eid al-Fitr, killed more than 90 people in one of the deadliest days in Iraq this year.