IS claims Baghdad twin bombing that killed 32, wounded 110
It was the deadliest attack on the city in three years, when another suicide bomber targeted the same area.
The first attacker drew a crowd at the bustling market in the capital's Tayaran Square by claiming to feel sick, then detonated his explosives belt, the interior ministry said.
As more people then flocked to the scene to help the victims, a second suicide bomber set off his explosives.
The open-air market, where second-hand clothes are sold at stalls, had been teeming with people after the lifting of nearly a year of Covid-19 restrictions across the country.
An AFP photographer at the scene said security forces had cordoned off the area, where blood-soaked clothes were strewn across the muddy streets and paramedics were rushing to take away the casualties.
The health ministry said those who lost their lives had died on the scene of the attack, and that most of the wounded had been treated and released from hospital.
After midnight, IS posted a claim of responsibility for the attack on its online propaganda channels.
Such violence was commonplace in Baghdad during the sectarian bloodletting that followed the US-led invasion of 2003 and later on as IS swept across much of Iraq and also targeted the capital.
But with the group's territorial defeat in late 2017, suicide bombings in the city became rare. Baghdad's concrete blast walls were dismantled and checkpoints across the city removed.
'Senseless and barbaric'
President Barham Saleh led political figures in condemning Thursday's attack, saying the government would "stand firmly against these rogue attempts to destabilise our country".
Pope Francis, who hopes to visit Iraq in March, deplored the "senseless act of brutality".
The United States, the United Nations and the European Union strongly condemned the attack.
US acting secretary of state Daniel Smith said the bombings "were vicious acts of mass murder and a sobering reminder of the terrorism that continues to threaten the lives of innocent Iraqis".
UN Secretary-General Antonio Guterres issued an appeal "to the people of Iraq to reject any attempts to spread fear and violence aimed at undermining peace, stability and unity."
The EU called the attack "senseless and barbaric" and reiterated its "full support to the Iraqi authorities in the fight against extremism and terrorism."
The UN's Iraq mission offered condolences to the victims and said: "Such a despicable act will not weaken Iraq's march towards stability and prosperity."
Iran also denounced the attack, with foreign ministry spokesman Saeed Khatibzadeh saying his government was ready to assist Iraq "in the struggle against terrorism and extremism".
The attack, he said, was meant "to disrupt the peace and stability of Iraq and to provide a pretext for foreigners to maintain their presence there".
The attack comes as Iraqis prepare for an election, events often preceded by bombings and assassinations.
The 2018 attack took place just a few months before Iraq's last round of parliamentary elections.
Prime Minister Mustafa Al-Kadhimi had originally set this year's general election for June, nearly a year ahead of schedule, in response to widespread protests in 2019.
But authorities are in talks over rescheduling them to October, to give electoral authorities more time to register voters and new parties.
The IS seized a third of Iraq in 2014 and was dangerously close to the capital, but a ferocious three-year fight by Iraqi troops pushed them back.
Still, the group's sleeper cells have continued to operate in desert and mountain areas, typically targeting security forces or state infrastructure with low casualty attacks.
The US-led coalition that had been supporting Iraq's campaign against IS has significantly drawn down its troop levels over the past year, citing the increased capabilities of Iraqi forces.
The United States, which provides the bulk of the force, has 2,500 troops left in Iraq - down from 5,200 a year ago.
They are mainly in charge of training, providing drone surveillance and carrying out air strikes while Iraqi security forces handle security in urban areas.