KABUL When a convoy of Red Cross workers drove into remote northern Afghanistan on Wednesday with supplies for victims of snow storms, they were entering a region that had recently seen dangerous and unpredictable changes.
Long under Taliban control, the corner of Jowzjan province had been infiltrated over the past year by rival Islamist militants claiming allegiance to Islamic State, according to local police officials.
It was those militants who police suspect attacked the convoy, killing six Afghan aid workers. Two more are missing.
The killings were an example of a growing problem for non-governmental organisations: as insurgent groups gain ground from government forces and fight among themselves, Afghan territory changes hands more quickly, leaving NGOs scrambling to keep up.
"It makes us fear for the future of our operations, because all of the serious aid organisations operate without armed guards, and we can be easy targets in this changing environment," said Dejan Panic, programme director for Emergency, an Italian healthcare charity.
He added that his group was reviewing its movements after the Red Cross attack.
The International NGO Safety Organisation said old battle lines between NATO and Taliban fighters were being replaced "by multiple overlapping conflicts both between and within Afghan groups."
The result is heightened confusion, suspicion and threats, aid groups say, even those that have worked in Afghanistan for decades and are well versed in negotiating with all sides of the conflict.
More than 40 percent of the country is contested or under insurgent control, according to U.S. military estimates, as Afghan forces struggle to contain a stubborn Taliban.
In the past year, militant groups have also fractured and Islamic State has established a foothold.
"There is no doubt that our operations are increasingly affected by increased insecurity," said Khalid Fahim, a programme director for the Swedish Committee for Afghanistan, which runs several aid projects.
International and local aid agencies, which run most of Afghanistan's humanitarian and social programmes and many schools and hospitals, have been forced to take snap decisions on whether or not to continue providing aid.
In Kunduz province in the north, for example, Fahim said the Swedish Committee was able to reopen facilities that had to be temporarily closed during heavy fighting.
In Wardak, on the other hand, threats from local Taliban commanders forced the organisation to close schools in two districts.
For Emergency, operations calmed down in some districts of Helmand province after the Taliban solidified control, ending months of fighting.
Abdul Fatah, an ambulance driver for an NGO-operated hospital in Ghazni province, said he was recently stopped by Taliban fighters, detained overnight and threatened with death if he evacuated wounded government police and soldiers.
Now he says he is caught between two sides.
"I'm trying to avoid taking military personnel to hospitals any more, but if there is a need, I have to. If I don't, the government forces will cause problems for me."
The United Nations attributed nearly 80 percent of incidents targeting healthcare workers in 2016 to anti-government groups like the Taliban.
But the group's spokesman Zabihullah Mujahid said the Taliban welcomed humanitarian aid and had a committee to oversee requests to work in their territory.
When the Red Cross workers were attacked in Jowzjan, Mujahid promised that the Taliban would help find the perpetrators.
As the Taliban movement has fractured, however, NGOs say fighters do not always follow orders.
"The practices on the ground often conflict with what leaders say at the high levels," Fahim said of both insurgent and government forces.
The Swedish Committee and Emergency said they did not interact officially with insurgents, but built relationships with local elders who acted as conduits to the militants.
"What facilitates access is acceptance and impartiality," Fahim said. "We are there for the people of Afghanistan. If people want us, then they facilitate the access."
That channel is not necessarily open to Islamic State, which, while much smaller than the Taliban in Afghanistan, has become increasingly deadly in recent months.
Christine Monaghan, a research officer for advocacy NGO Watchlist on Children and Armed Conflict, said this week's attack indicated that Islamic State, also known as ISIS, was spreading across Afghanistan.
"In areas where ISIS has tried to expand its influence, residents are often caught between the Taliban, government forces, and ISIS in a back-and-forth," Monaghan said.
If NGOs continue to operate in expanding areas controlled or contested by the Taliban or other groups, aid organizations say they face suspicion and pressure from the government.
In one incident last year, Afghan intelligence agents seized an NGO's convoy carrying medical supplies to rural districts in Kunduz province, according to the United Nations.
The trucks were only released after health ministry officials intervened.
Defence Ministry spokesman Mohammad Radmanish said security forces were obliged to search and question anyone coming or going from frontline areas.
"This is our right and it is the culture all over the world," he said.
(Additional reporting by Mirwais Harooni; Editing by Mike Collett-White)