Afghan troops have fought to regain control over the northern city of Kunduz after Taliban fighters captured the center of the provincial capital they had briefly seized about a year ago.
The Taliban fighters entered Kunduz on October 3 after attacking the city from four sides, triggering heavy fighting with government forces.
The insurgents managed to reach the city's main square, where they reportedly raised their flag.
By late evening, the militants had been driven out of the city center, NATO and the Afghan government said.
"Government controls Kunduz City and Afghan security forces are in control of the main square with additional troops coming," the NATO forces stationed in Afghanistan said on Twitter.
The Afghan Ministry of Defense said on Twitter that the Taliban fighters were fleeing and that "dead bodies are left on the battlefield."
The ministry added that attacks were ongoing on all the Taliban positions.
Kunduz fell for a few days to the Taliban one year ago in a battle that the United Nations said left 289 people dead and hundreds more wounded.
Meanwhile, in the southern province of Helmand, officials said militants seized a district to the south of the provincial capital, Lashkar Gah, killing the local police chief.
A police official said the fighting in the Nawa district between security forces and Taliban militants was ongoing.
The attacks come ahead of an international donors conference starting in Brussels on October 4, where Afghanistan's international partners will discuss aid to the country.