The Afghan government has launched a major offensive against Taliban forces near the north-eastern provincial capital of Kunduz.
The Taliban have come close to the city in recent fighting, leaving it cut off with tens of thousands of displaced.
A BBC correspondent who has flown into Kunduz has heard gunfire and artillery exchanges not far from its centre.
Afghan officials say foreign jihadists trained by the Islamic State (IS) group are fighting alongside the Taliban.
Provincial governor Mohammed Omer Safi told the BBC that the bodies of 18 foreign fighters including two women had been found.
Security forces and Taliban have been involved in a standoff for about a week after the insurgents launched an offensive on Kunduz at the end of April.
The insurgents are currently said to be massed in Gul Tepa district on the southern outskirts of the city.
At the scene: David Loyn, BBC News, Kunduz
This is the first positive confirmation by a senior government official that Islamic State are operating alongside the Taliban in Afghanistan.
Until now, particularly in the south of the country, IS fighters have often clashed with the Taliban. But the governor said that the battle for the north is different, and here IS fighters are "supporting the Taliban, training the Taliban, trying to build the capacity of the Taliban for a bigger fight".
And he said they are more violent because they are wanting to die in battle as martyrs.
The bodies of 18 foreign fighters found after recent fighting included two women.
As well as those from Afghanistan's immediate northern neighbours, Tajikistan, Uzbekistan, and Kyrgyzstan, those killed came from Chechnya and Turkey. They were wearing black headbands marked with the same Islamic verses used by IS in Syria and Iraq.
Correspondents say the advance is the most serious threat to a provincial capital in years.
Afghan army and police are involved in the fighting but there is no substantial help from foreign troops.
The BBC's David Loyn in Kunduz says this is a low-tech war run from the ruins of a hill fort, a high vantage point where the sounds of fighting can clearly be heard and commanders issue orders on mobile phones.
Governor Safi said the Afghan forces did not have enough air power and their helicopters lacked the armaments they should have.
Only a few thousand Nato troops remain in the country, largely in training roles, after their combat mission ended in December. They have turned down several requests to assist with air strikes.
People displaced by the fighting are spread across the city and rural areas of the province of Kunduz.
Our correspondent says some of the displaced have moved to villages and are squatting in farmyards.
He says that if the fighting is prolonged it could lead to a bigger problem if there is a failure to bring in the harvest this month.
Kunduz supplies half of Afghanistan's rice crop, so if the fighting goes on it could have a far-reaching impact beyond the lives affected here, he adds.
International aid agencies are trying to assist the displaced, with the World Food Programme preparing emergency kits of flour, pulses, cooking oil and high-energy biscuits for 500 families, spokesman Wahiddullah Amini told Reuters news agency.