Iraqis gather at the scene of a bomb attack in Baghdad's Sadr city on Sunday. A twin bomb attack killed at least 28 people and wounded dozens of others at a popular market. (Ahmed Ali/European Pressphoto Agency)

Islamic State militants killed dozens of people in two major attacks on Baghdad on Sunday, bombing a market and assaulting security forces on the city’s outskirts in a demonstration of the group’s ability to disrupt the Iraqi capital even as it loses ground.

Six car bombs were used in the early-morning attack on Abu Ghraib, a neighborhood on the city’s western edge where the militants seized a grain silo, Iraq’s Ministry of Defense said. Later in the day, a double suicide bombing hit a market in the largely Shiite district of Sadr City, killing at least 28 people, according to Iraqi media.

The Abu Ghraib assault marked the most significant attack on the area in more than a year and came despite an ongoing operation by Iraqi security forces to push back militants from the city’s western edge.

Still, the Islamic State has lost 30 percent of its territory in the country since its 2014 peak, and Prime Minister Haider al-Abadi on Sunday night said the group is lashing out because it is under pressure.

A soldier walks at the site of suicide blasts in Baghdad's Sadr city on Sunday. (Wissm Al-Okili/Reuters)

The bombing in Sadr City, following another on Thursday that hit a Shiite mosque in the Baghdad neighborhood of Shoula, increases “the resolve and determination” of Iraqi security forces, ­Abadi said.

In Sadr City, a frequent target for bombings, residents used vegetable carts to transport the wounded from the scene, video footage showed. Many of the dead were children, according to the Defense Ministry.

In response to the bombing in the neighborhood named after his father, the prominent cleric Moqtada al-Sadr called on fighters with his militia, formerly the Mahdi Army but now known as the Peace Brigades, to be on standby to defend the capital.

“I call on the government to be alert to the threat posed to Baghdad, rather than being busy collecting money,” he said.

Sadr has been reasserting himself politically in recent weeks, holding a huge rally in the capital last week calling for reforms.

Islamic State militants managed to hold the grain silo on the edge of Abu Ghraib for hours before Iraq’s elite counterterrorism forces were called in. Maj. Gen. Saad Harbiya, a commander with Baghdad Operations Command, said most of the attackers were foreigners, with 20 besieged in the silo at one point in the afternoon.

Iraqi men clean up after a bombing claimed by the Islamic State group near a market in the Sadr City area of northern Baghdad on Sunday. (Ahmad Al-Rubaye/AFP/Getty Images)

He said security forces suffered a “simple” number of casualties, declining to give a figure. Seventeen members of the Iraqi security forces were killed, according to Reuters. The Islamic State claimed responsibility for both attacks in statements distributed on social media.

The Abu Ghraib neighborhood is home to the notorious prison of the same name. Leaked photos of the mistreatment of Iraqi prisoners there by American soldiers during the early years of the war in Iraq caused a worldwide scandal.