Heavy fighting between Afghan security forces and Taliban fighters has killed more than 30 people and threatened a major northern city, officials said.

The battle on the outskirts of Kunduz on Monday, part of a stepped-up wave of attacks after the departure of most foreign troops, prompted President Ashraf Ghani to delay his departure on a state visit to India by several hours.

Officials said hundreds of Taliban fighters attacked police and army checkposts in the wider province of Kunduz, the group's last stronghold before US coalition forces drove them from power in 2001.

Now they threaten to overrun parts of the provincial capital, after fighting that killed eight Afghan security forces and at least two dozen Taliban, a spokesman for the provincial governor said.

"The threat level is very high, but with new reinforcements, our security forces have gained morale and god willing, we will win the fight," the spokesman, Abdul Waseh Basel, said.

The fighters overran seven army and police checkposts in central Kunduz and two districts, Taliban spokesman Zabihullah Mujahid said in an emailed statement.

Presidential spokesman Ajmal Obidy said Ghani left for India late on Monday afternoon. He had delayed his departure for New Delhi to meet NATO's General John Campbell at the presidential palace to discuss the Kunduz fighting, Campbell said.

Battles were raging about 6km south of Kunduz city, officials said. Fighters also broke into the city itself, in the southern district of Gul Tepa, Basel told the Reuters news agency.

Afghan security forces used artillery in defense.

"The sound of heavy weapons fired by Afghan forces can be heard in the city," Kunduz police spokesman, Sayed Sarwar Hussaini, said.

Taliban members, including foreign fighters, this month launched major attacks in another northern province, Badakhshan, and on Monday fired on a government delegation meeting armed forces there.

Rockets and gunfire from the Taliban narrowly missed the group, led by Ahmad Zia Massoud, head of Ghani's governance commission, a close aide said. The delegation quickly withdrew by helicopter.

Source: Agencies