Twin suicide blasts in Baghdad claimed by the Islamic State group have exposed gaps within Iraq's security forces, weakened by the Covid-19 pandemic, rival armed groups and political tensions.
At least 32 people were killed and more than 100 wounded in the double-tap suicide attack that targeted a commercial district in Baghdad on Thursday.
It was the deadliest attack in three years in the capital, which has been relatively calm since IS's territorial defeat in late 2017.
But it has also illustrated accumulating shortfalls in Iraq's patchwork of security forces, experts said.
"IS isn't coming back. The fact that this is news shows how good the situation has become compared to the past," said Jack Watling, a research fellow at the Royal United Services Institute in London.
"But there are some very clear problems in the Iraqi security sector, and this is reflective of that."
Following the US-led invasion in 2003, Iraq's security forces had to be effectively rebuilt from the ground up, relying heavily on training by foreign armies.
The Covid-19 pandemic put an abrupt halt to that.
Living together at bases with little social distancing, Iraqi troops were some of the country's first coronavirus victims.
In March 2020, the US-led coalition announced it was pulling out foreign trainers to stem the pandemic's spread.
"The decreased training over the past year because of Covid-19 (created) a gap there," a top US official in Baghdad told AFP last month.
It also meant Iraq's security services had decreased access to the coalition's communications surveillance -- "an early warning system" that was crucial to nipping IS attacks in the bud, said Watling.
- 'Gap to exploit' -
Many of those withdrawals became permanent.
The US-led coalition announced last year that Iraq's army was capable of fighting IS remnants on its own and pulled out of eight bases across the country.
At the same time, citing the improving security situation, Baghdad's authorities lifted the concrete blast walls and checkpoints that had congested the city for years.
Battle-hardened units were moved out of cities to chase down IS sleeper cells in rural areas, with less-experienced units taking over urban security.
Security analyst Alex Mello said those rotations combined with less-reliable intelligence may have eventually granted IS "a gap to exploit".
The US official said Iraqi forces were at times unwilling to tackle IS fighters head-on, allowing small cells to flourish into larger groups.
One coalition air strike near Mosul in December killed 42 IS jihadists -- an unusually large number.
"The senior commanders in Baghdad were extremely pissed at the local forces. They had to know those guys were there," the US official said.
But the core challenge may not be technical.
Iraq's security forces include army troops, militarised police units and the Hashed al-Shaabi, a network of armed forces incorporated into the state after 2014.
Many were backed by Iran, which generated a mutual distrust with some forces trained by its arch enemy, the United States.
Tensions spiked following the US drone strike last year that killed top Iranian general Qasem Soleimani and Hashed deputy chief, Iraqi commander Abu Mahdi al-Muhandis.
"The real strain has been political," said Watling.
"During the fight against IS, there was a lot of informal information sharing between the Hashed, the coalition and others. That's just not there anymore, which reduces situational awareness," he said.
- 'No one is clean' -
Navigating those tensions has been a major challenge for Prime Minister Mustafa al-Kadhemi, seen as US-friendly.
He rose to the premiership in May while retaining his previous post as head of Iraq's intelligence service.
Kadhemi has relied heavily on the US-trained Counter-Terrorism Service for a range of missions: hunting down IS cells, arresting corrupt officials and even reigning in groups launching rockets on the US embassy.
Observers say it is because he trusts so few other units.
But it has also forced the CTS into uncomfortable confrontations with pro-Iran factions that have often ended with the former backing down.
"Constantly retreating on orders and apologising to the targeted groups only weakens the CTS, the commander-in-chief, and the Iraqi state," said Marsin Alshamary, a Brookings Institute research fellow.
Following Thursday's attack, Kadhemi announced an overhaul of Iraq's security leadership, including a new federal police commander and chief of the elite Falcons Unit.
Kadhemi is hoping those changes will not only plug holes that Thursday's attackers exploited, but could also resolve the deeper issues of trust and coordination.
But observers were sceptical of how far that could go given widespread graft in Iraq's security forces.
"When you're dealing with a corrupt bureaucracy, no one is clean," said Watling.