A little more than a month after toppling the Western-backed government in Kabul, Afghanistan's new Taliban rulers are facing internal enemies who have adopted many of the tactics of urban warfare that marked their own successful guerrilla campaign.
A deadly attack on Kabul airport last month and a series of bomb blasts in the eastern city of Jalalabad, all claimed by the local affiliate of Islamic State, have underlined the threat to stability from violent militant groups who remain unreconciled to the Taliban.
While the movement's spokesman Zabihullah Mujahid has downplayed the threat, saying this week that Islamic State had no effective presence in Afghanistan, commanders on the ground do not dismiss the threat so lightly.
Two members of the movement's intelligence services who investigated some of the recent attacks in Jalalabad said the tactics showed the group remained a danger, even if it did not have enough fighters and resources to seize territory.
Using sticky bombs - magnetic bombs usually stuck to the underside of cars - the attacks targeted Taliban members in exactly the same way the Taliban itself used to hit officials and civil society figures to destabilize the former government.
"We are worried about these sticky bombs that once we used to apply to target our enemies in Kabul. We are concerned about our leadership as they could target them if not controlled them successfully," said one of the Taliban intelligence officials.
Islamic State in Khorasan, the name taken from the ancient name for the region that includes modern Afghanistan, first emerged in late 2014 but has declined from its peak around 2018 following a series of heavy losses inflicted by both the Taliban and U.S. forces.
Taliban security forces in Nangarhar said they had killed three members of the movement on Wednesday night and the intelligence officials said the movement still retains the ability to cause trouble through small-scale attacks.
"Their main structure is broken and they are now divided in small groups to carry out attacks," one of them said.
Funding dried up
The Taliban have said repeatedly that they will not allow Afghanistan to be used as a base for attacks on other countries. But some Western analysts believe the return of the Islamist group to power has invigorated groups like ISIS-K and al Qaeda, which had made Afghanistan their base when the Taliban last ruled the country.
"In Afghanistan, the return of Taliban is a huge victory for the Islamists," said Rohan Gunaratna, professor of security studies at Singapore's Nanyang Technological University. "They have celebrated the return of the Taliban, so I think that Afghanistan is the new theatre."
ISIS-K is believed to draw many of its fighters from the ranks of the Taliban or the Pakistani version of the Taliban, known as the TTP, but much of the way it operates remains little understood.
It has fought the Taliban over smuggling routes and other economic interests but it also supports a global Caliphate under Islamic law, in contrast with the Taliban which insists it has no interest in anywhere outside Afghanistan.
Most analysts, as well as the United Nations, peg ISIS-K's strength at under 2,000 fighters, compared to as many as 100,000 at the Taliban's disposal. The ranks of ISIS-K were swollen with prisoners released when Afghanistan's jails were opened by the Taliban as they swept through the country.
According to a June report by the UN security council, ISIS-K's financial and logistic ties to its parent organisation in Syria have weakened, though it does retain some channels of communication.
"Funding support to the Khorasan branch from the core is believed to have effectively dried up," the report said.
However, the report said signs of divisions within the Taliban, which have already started to emerge, could encourage more fighters to defect as the wartime insurgency tries to reshape itself into a peacetime administration.
"It remains active and dangerous, particularly if it is able, by positioning itself as the sole pure rejectionist group in Afghanistan, to recruit disaffected Taliban and other militants to swell its ranks," the UN said.