It said some fighting was continuing on the fringes of Qala-e-Naw, capital of Badghis province, which borders the central Asian country of Turkmenistan.
Insurgents had on Wednesday seized key government buildings in the city including police headquarters as part of a dramatic Taliban advance unfolding as foreign forces withdraw from Afghanistan after a 20-year-long intervention.
“The city is fully (back) under our control and we are conducting operations against the Taliban on the outskirts of the city,” Defence Ministry spokesman Fawad Aman said.
The ministry said 69 Taliban fighters had been killed in fresh operations on the edge of Qala-e-Naw – the first major provincial capital entered by the Islamist insurgents in their latest offensive.
A large quantity of Taliban arms and ammunition was also seized by government forces, the ministry said on Twitter.
The rest of Badghis province is in Taliban hands. Western security officials say the Taliban have captured more than 100 districts in Afghanistan; the Taliban say they hold over 200 districts in 34 provinces comprising over half the country. Main cities and provincial capitals remain under government control.
The insurgents have been gaining territory for weeks but accelerated their thrust as the United States vacated its main Afghan base, effectively ending an intervention that began with the ousting of the radical Islamist Taliban government in 2001.
Taliban advances have been especially dramatic in northern provinces where they had long been kept at bay. Stop-start peace talks between the government and insurgents remain inconclusive.
Later on Thursday, US President Joe Biden is scheduled to comment on the US withdrawal, which has raised fears of an outbreak of civil war there and drawn criticism.