Taliban militants from Swat are said to have launched the attack
Police in the eastern Afghan province of Nuristan have called for help after fierce clashes with hundreds of Taliban fighters they say are from Pakistan.
Seven Taliban and two policemen have been killed in the fighting so far, the Afghan interior ministry says.
Officials say nearly 300 insurgents led by Pakistani Taliban leader Maulana Fazlullah entered the area this week.
Maulana Fazlullah led the Taliban in Pakistan's north-western Swat valley until a military offensive in 2009.
The Pakistani military retook the area and he was reported to have been killed, but in an interview with the BBC in November Maulana Fazlullah said that he had escaped to Afghanistan.
The Afghan interior ministry spokesman said that police in Nuristan had asked the authorities in Kabul for support and forces had been sent to help them.
Officials have described the attack on Barg-e-Matal district as "brazen".
Nuristan governor Jamaloddin Badr said intense fighting was still raging in the district between police and Maulana Fazlullah's men.
Reports say the insurgents attacked the district government building and a small police force has been trying to hold them off.
Gen Mohammad Qasim Jangulbagh, the provincial police chief, told the Associated Press: "There are many fewer police than attackers but we have the locals helping us."
He said police had asked for reinforcements, but they were still to arrive.
Tribal areas in north-western Pakistan have long been seen as a safe haven for Taliban militants who cross the border to launch attacks in Afghanistan.