Pictures on social media showed Taliban members standing in front of the gate of the Panjshir provincial governor's compound after days of fighting with the National Resistance Front of Afghanistan (NRFA), commanded by Panjshiri leader Ahmad Massoud.
"Panjshir, which was the last hideout of the escapee enemy, is captured," Taliban spokesman Zabihullah Mujahid told a news conference.
Massoud did not concede defeat, saying his force, drawn from the remnants of the regular Afghan army as well as local militia fighters, was still fighting.
"We are in Panjshir and our Resistance will continue," he said on Twitter. He also said he was safe, but gave no details on his whereabouts.
The steep valley north of Kabul was long famed for holding out against attack. It was the main redoubt of the Northern Alliance resistance fighters who toppled the Taliban with US air support in 2001 after the Sept. 11 attacks on the United States.
The Taliban assured the people of the valley - who are ethnically distinct from the mainly Pashtun Taliban - that there would be no "discriminatory act against them".
"They are our brothers and would work together for a joint purpose and welfare of the country," Mujahid said.