KABUL, Afghanistan — Hundreds of Taliban fighters overwhelmed a remote district in northeastern Afghanistan on Saturday in an area where the government’s influence has waned considerably over the past two years, provincial officials said.

The governor of Badakhshan Province, Waliullah Adeeb, said that Afghan security forces had retreated about half a mile from their position in the administrative center of Yamgan District, a sparsely populated and mountainous area. The Taliban had seized the district center last year, as well, before falling back.

The attack began at 4 a.m. on Saturday and involved as many as 300 Taliban fighters, said Col. Sakhi Haideri, the deputy police chief of the province. Colonel Haideri said the Taliban’s acting shadow governor in Badakhshan, Maulavi Amanuddin, was leading the attack.

By 11 a.m., the Taliban had seized the district center, said Zalmai Mojadedi, a lawmaker from Badakhshan. Eight Afghan police officers were killed in the fighting, Mr. Mojadedi said.