ON THE edge of a dusty plateau near the northern city of Kunduz, Mohammad Khan and his family shelter in a threadbare tent. From here, he says, he can almost see his house 8km (5 miles) away across a river in Chahar Dara district. But there is a good chance it is now occupied by a Taliban fighter and his family. The area was recently overrun by insurgents who have made big advances in this part of Afghanistan, especially near the border with Tajikistan.

The Taliban, bolstered by foreign fighters, have chosen Kunduz—a city far from the traditional Taliban heartland in Pushtun-dominated areas beside the border with Pakistan—as the focus for their annual spring offensive. Fighting in May displaced perhaps 6,000 families in Kunduz province, after the city itself almost fell to the insurgents in late April. “The army can’t push them back, even with helicopters and heavy weapons,” says Mr Khan.

Because Afghan forces are fighting for the first time without much support from NATO, their casualties are unusually high. The authorities are reluctant to give figures, but a Western military official quoted by the New York Times said more than 1,800 soldiers and police officers had been killed and another 3,400 wounded between January and April—65% more than in the same period last year. On May 25th 26 government soldiers were killed during a siege of a police headquarters in southern Helmand province.

Despite such losses, many Afghans say their government is proving slow to respond to Taliban assaults. A full eight months after his inauguration as president, Ashraf Ghani has only just nominated a defence minister, who is yet to be approved by parliament. Not even Kabul feels safe. Two weeks ago, gunmen stormed a hotel in the capital, killing 14 people, including nine foreigners. A week later, a suicide bomber got into the grounds of the justice ministry, killing at least five employees. On May 27th an upmarket part of the city was attacked again. Four gunmen were killed after trying to storm a guesthouse.

The national government has dispatched several thousand soldiers to help in Kunduz, the scene of the worst fighting so far. It has also resorted to less savoury tactics which have been routine since at least 2009, quietly recruiting local warlords and their militias (pictured) to help confront insurgents. That should help to check the immediate threat, but by adding to already big supplies of weapons on the ground the government risks spreading instability, as rival anti-Taliban groups clash among themselves.

It is not surprising that Kunduz is a scene of such conflict. Commanders from the former Northern Alliance have long fought, often brutally, for turf in the north of the country. For unlucky residents that has meant enduring extortion, harassment and revenge killings. Gradually the authority of the government has ebbed away.

Today a powerful militia commander, Mohammad Omar, claims to control 400 armed men in Khanabad district. He uses the moniker Pakhsaparan, meaning “wall-crusher”, and says he is fighting the Taliban without help from the national army and only $1,000 a month from the local police chief. “I get the rest in taxes from farmers,” he says, without elaborating on his collection methods. The government denies rearming militias, though it admits to “selective voluntary citizens’ participation” in the fight against the Taliban. Either way, Mr Ghani’s supposed strategy of marginalising powerful warlords while strengthening local government appears to be forgotten. One fear is that militias, locally called arbaki, could revert to rape, murder and other abuses of civilians, as happened during the civil war in the 1990s. That, in turn, could spread sympathy for the Taliban, which at least offer some form of order. “During the day they are arbaki, during the night they are thieves,” says Mr Khan, the refugee near Kunduz city. Another worry is that a new faction of rebels could emerge. There are rumours that fighters under the black banner of the Islamic State (IS) are growing more powerful. Displaced villagers tell of seeing armed men in IS’s trademark masks and black clothes. They are said to be well equipped, and wealthy enough not to extort money from civilians. Accounts vary as to whether they are with or against the Taliban.

There is little evidence that IS has a force to be reckoned with in Afghanistan, nor that those who use its name have formal links with IS in the Middle East, which never mentions an Afghan presence. A group describing itself as IS claimed responsibility for an attack in the eastern city of Jalalabad in April that killed 30 people. But its connection, if any, with IS elsewhere is unclear.

More likely, disaffected members of the Taliban are adopting the IS brand because it is well-known and helps attract recruits and funding. Some younger fighters are said to complain that the Taliban lack strong leaders. The group’s spiritual head, Mullah Omar, has not been seen in public since 2001. A former Taliban commander, Mullah Abdul Rauf Khadim, who had been detained in Guantánamo Bay, began recruiting fighters in the name of IS this year in Helmand Province. He was killed by a drone strike in February. The Americans all but admitted they did it.

The Taliban would be unlikely bedfellows of IS. The Pushtun-nationalist Taliban have little interest in IS’s dream of a transcontinental caliphate. They seem ready to countenance political negotiations one day with authorities in Kabul, which IS would not. America’s most senior officer in Afghanistan, General John Campbell, talks up the idea that IS adherents have been clashing with the Taliban. But a proliferation of factions among the insurgents is hardly a reason to celebrate. On the government side, too, power is also being shared, with militias. That is a recipe for more uncertainty—and, presumably, for more bloodshed.