Taliban militants launched a coordinated attack on Kunduz city, the capital of the province of the same name and one of the most embattled provinces in Afghanistan's north, a security official said.
"The Taliban started attacking Kunduz city at 2 am, coming from four directions," police spokesman Mahfozullah Akbari said. He rejected earlier media reports that said the Taliban had advanced into the city centre.
Fighting was under way in the areas of Zakhil and Qahwakhana, outside Kunduz city, but special forces were able to push the Taliban back in many locations, Akbari said.
"The situation has changed with the Taliban retreating from their positions."
Kunduz city resident Mohammad Omid said that helicopters were flying over the city, but that there was no fighting.
Shops and markets were closed, with people staying inside their homes.
A resident living on the outskirts of Kunduz, who wanted to remain anonymous, said his family was trapped inside the basement of their house, about a kilometre west of the city.
"Taliban are outside our house, on the roofs of the neighbours and roaming the streets. We can still hear fighting going on around us and jets and helicopters flying," he said.
"The Taliban came very suddenly, and we are really afraid to go out. The government has said that they are launching an offensive to take back the areas, we don't know how long that will take," he added.
NATO's Resolute Support Mission spokesman Brigadier General Charles Cleveland said that they were monitoring "ongoing sporadic fighting in Kunduz" and were coordinating closely with their Afghan partners to assist.
Taliban spokesman Zabihullah Mujahid said in a tweet that Kunduz city was under intense attack from four directions and that the militants had entered Nawabad city and overrun four checkpoints.
In September last year the Taliban took the strategically important city for two weeks, which came as a shock to the Afghan government and to the international community.
It was the first time the insurgents had taken over a major urban centre since the US-led offensive overthrew the Taliban regime 15 years ago.
The battle took place just days before the Brussels conference on Afghanistan where world leaders are expected to pledge economic assistance for the country's development.