"After several hours of heavy gunfight, Afghan security forces managed to take control of Taywara district centre in Ghor province on Friday morning," the spokesman for the Ghor provincial governor, Abdulhai Khatibi, told dpa, adding that the operation had started early on Thursday morning.
Confirming the recapture, a military spokesman, Abdul Basir Ghori, said that, with the help of the air force, Afghan security forces inflicted heavy casualties on the fighters, with 59 of them killed and dozens of others injured.
At the moment there is no information on civilian and Afghan force casualties, Ghori added.
The warring parties in Afghanistan often distort casualty figures.
According to Ghori, the search and clearance operation was continuing in the surrounding areas, and there was a gunfight.
"Taliban insurgents have burned all the buildings of government institutions, including a health clinic, during the past four days when they were controlling the district centre," Ghori said.
Taywara had fallen to the Taliban on Sunday after several days of fierce clashes with government forces.
The central province of Ghor shares borders with two insecure provinces, Farah in the northwest and Helmand in the south, both of which are known as strongholds for Taliban fighters.
In recent days, the Taliban have been increasing their attacks on districts across the country.
On Tuesday, they took control of Jani Khel in south-eastern Paktia province.
Fighting also broke out in Kunduz and Baghlan provinces in Afghanistan's north, Badakhshan in the north-east, Ghor in the centre and Helmand and Kandahar in the south.
On Tuesday night, at least 26 Afghan army soldiers were killed and 13 injured in a Taliban attack on an army base in southern Kandahar province.
There has been a surge in fighting in several northern and southern Afghan provinces in recent days, including in Helmand in the south.
There, amid the fighting, a US air raid last Friday killed at least 16 Afghan police officers in friendly fire.
Afghan troops and police are battling largely alone on the ground against anti-government forces, after US-led foreign forces withdrew from most combat operations in December 2014.
The US is actively considering sending more troops to Afghanistan and US commanders there have requested thousands of extra soldiers on the ground.
The US contingent now numbers about 8,400, and there are another 5,000 from NATO allies, a far cry from the US presence of more than 100,000 six years ago. They mainly serve as trainers and advisers.
Civilian casualties in Afghanistan in 2016 were the highest recorded by the United Nations, with nearly 11,500 non-combatants - a third of them children - killed or wounded.
Source: News agencies