The recapture is a welcome piece of good news for government forces, which have struggled to contain the spreading Taliban insurgency since international troops wound up most combat operations at the end of 2014.
Combined army, police and special forces units took back Darqad district, on the border with Tajikistan, in the early hours of Sunday, the defense ministry said.
“A clearance operation is going on and the situation is under control,” it added.
The Taliban briefly captured the northern Afghan city of Kunduz last year and have overrun large parts of the southern province of Helmand, where the United States has launched air strikes and deployed special forces to help badly squeezed Afghan troops and police.
The fighting has continued as Afghan and Pakistani officials, along with counterparts from China and the United States, prepare for meetings in Islamabad next week to lay the ground for possible peace talks with the Taliban.