Afghan officials said government troops had recaptured much of the strategic northern city of Kunduz from Taliban insurgents early on Thursday, three days after losing control of the provincial capital in an embarrassing defeat for Kabul and its U.S. allies.
Details of the overnight counter-offensive and which areas were back under government control were not immediately clear.
Afghan forces, backed by U.S. air strikes, had been struggling for two days to retake the city, after it became the first provincial capital to fall in to Taliban hands since 2001.
"Afghan security forces got control of Kunduz city from Taliban overnight after heavy fighting," Hamdullah Danishi, acting governor of Kunduz, told Reuters by telephone.
"After we got reinforcements and started a massive operation inside Kunduz city, the Taliban could not resist and escaped. ... We will give a full report soon," he added.
Interior Minister spokesman Sediq Sediqqi said on Twitter: "It is retaken and being cleared from terrorists, heavy casualty to the enemy."
There were no immediate details about any civilian casualties in the city of 300,000 during the new offensive.
The Taliban, who have been fighting to re-establish their hardline Islamist rule after being toppled from power by a U.S.-led intervention in 2001, could not be immediately reached for comment.
On Monday, the insurgents' pre-dawn assault on Kunduz from four directions caught Afghan police and army by surprise.
Almost the entire city had fallen into Taliban hands by nightfall, with government officials and forces retreating to the airport outside the city.
The city's capture was a blow to the narrative by the Kabul government and its U.S. backers that the NATO-trained Afghan police and army were steadily improving and able to prevent the Taliban from taking over and holding significant territory.
Training the 350,000 strong Afghan National Security Forces has been the heart of the U.S. plan to end involvement in its longest war. American and allied forces official ended their combat role at the end of last year, leaving behind a training and advising force of several thousand.
While the government's recapture of Kunduz had been expected, the police and army struggled for two days even as Afghan President Ashraf Ghani tried to assure citizens that the situation was under control.
The Taliban mined roads to block reinforcements arriving and launched an assault on the airport where some 5,000 government officials and troops were based.
U.S. and allied troops were dispatched to Kunduz to advise and assist the Afghan forces, with at least five U.S. air strikes hitting Taliban positions near the airport and on the city's outskirts.
Late Wednesday, Afghan reinforcements broke through the Taliban defences and reached the airport to prepare the ground for Thursday's counter-offensive.
Afghan Deputy interior Ministry Mohammad Ayub Salangi praised the recapture on hi Facebook page.
"I want to congratulate terrorist defeat in Kunduz to the great nation of Afghanistan and our international allies."