The Taliban and the Islamic State (IS) group are creating a perfect storm of carnage in Kabul, adapting to ramped up security in the war-weary capital to strike again and again, and it is civilians who are paying the price.
Three times in the past 10 days Taliban and IS extremists have penetrated heavily fortified areas in Afghanistan's capital to carry out attacks that have killed and wounded hundreds of people, including foreigners.
The militants' chilling ability to hit at the heart of the country despite increased police checks has put security and intelligence failures in the spotlight.
After the latest assault on Monday, an IS-claimed attack on an army battalion that killed at least 11 soldiers, President Ashraf Ghani pledged in a tweet that “reforms in our intelligence services and Ministry of Interior are our top priority now”.
But as public anger swells, security officials are on the defensive.
“The terrorists are changing their tactics,” Mohammad Masoom Stanekzai, the head of Afghanistan's spy agency, told reporters on Sunday. “It does not mean a lapse (in security). We have foiled many attacks but some are difficult to control.”
On January 20 the Taliban launched the first of two massive attacks in Kabul: an hours-long assault on a luxury hotel in which at least 25 people were killed, including many foreigners.
One week later an ambulance laden with explosives detonated in a crowded street, killing more than 100 people and wounding hundreds more in one of the deadliest bomb blasts in Kabul in recent years.
The Taliban claimed responsibility, insisting the explosion had killed mainly police.
Also read: Kabul attacked, again
On Monday many residents awoke to the sounds of gunfire and explosions once more as IS militants attacked the battalion.
Relentless Taliban violence is not new to the city. But, analysts say, the insurgents' recent escalation is exacerbated by the lightning increase in IS attacks in the capital since 2016.
There is no reason to believe the Taliban and IS are partnering operationally, or conversely, competing to outdo each other, says Michael Kugelman of the Wilson Center in Washington, DC.
But “the cumulative effect of their attacks is simply devastating,” he told AFP.
As the Taliban ramps up its insurgency to drive out foreign forces and IS tries to expand its relatively small foothold in the country, Kabul is becoming more attractive for both groups, said Borhan Osman, a senior analyst with the International Crisis Group.
“Increasing pressure on the battlefield may be leading them to hit back in an area where they can publicly disprove the rhetoric of the United States (US) military or Afghan government that they have weakened the Taliban or IS,” Osman told AFP.
That "can also shake public confidence in the government's ability to protect the population".
Western officials have told AFP that the militants are adapting to new security measures, such as those implemented since a massive truck bomb in May 2017 killed around 150 and wounded about 400, in Kabul's deadliest attack since the US invasion.
Dozens of truck barriers, checkpoints and security cameras have been installed in the city's downtown and diplomatic areas.
Lorries entering Kabul via major roads are checked by security guards, sniffer dogs and scanners to ensure they are not carrying explosives, rockets or suicide vests.
Cars and their occupants are also physically examined by Afghan police.
The time-consuming checks result in hundreds of trucks waiting hours before they proceed, or being turned back if they do not have the correct paperwork.
But attackers continue to get through.
'Nowhere near sufficient'
Groups such as IS have recruited students, professors and shopkeepers, who hide in the open as they help carry out assaults.
The US training mission is meant to help plug the gaps, but has not managed to do so despite years in the country, said Kugelman, with the recent attacks underscoring that progress is “nowhere near sufficient”.
Militants operating in the city cannot be targeted with the amplified bombing campaigns used by the US in other parts of the country.
Some Afghan officials have acknowledged that the security measures in place are not foolproof, but appear to be at loss as to how to fix the problem.
“It is beyond the capacity of the police to control” all the entrances, a security official told AFP in October. “Kabul has more than a hundred ways into the city.”
As Kabul struggles to prepare for further strikes, Afghanistan's international allies are weighing the implications of the latest bloodshed.
Nato Secretary General Jens Stoltenberg said it was “essential to redouble efforts to achieve peace and reconciliation”.
But US President Donald Trump on Monday threw into question Washington's long-standing policy of pushing the Taliban towards the negotiating table.
“We don't want to talk with the Taliban,” Trump said. “They are killing people left and right.”
That carnage is unlikely to abate in the months ahead as militants, particularly the Taliban, come under pressure, according to Osman.
“I'm afraid they are turning Kabul into the battlefield as a message to say 'if you are taking the gloves off we can also do this'."