The army wants to encourage local support for the fight against the Taliban
Helicopter gunships have been sent to a district in north-western Pakistan to support hundreds of tribesmen fighting the Taliban, officials say.
Tribesman in Upper Dir blame the Taliban for a bomb attack on a mosque that killed 35 people on Friday.
Officials say they have been joined in their fight by residents from two villages and a town.
There are now about 2,000 of them fighting 200 surrounded Taliban militants, officials say.
Upper Dir district police chief Ejaz Ahmad said that militants including foreign fighters were putting up tough resistance in the villages of Shatkas and Ghazi Gai.
But he said that the tribesmen were foiling the fighters' attempts to flee.
Senior police officer Rahim Gul told Reuters news agency that two helicopters had attacked the militants.
"There must be militant casualties but we don't know at the moment," Mr Gul said.
He said more people were joining the tribesmen, who were making advances after heavy clashes. Paramilitary soldiers had set up mortars on high ground above the village.
The army says that it did not come to aid the tribesmen earlier because they were engaged in close-quarter fighting with the Taliban and the military was worried it might hit them by mistake.
Dozens of people were injured in Friday's attack on the mosque
Correspondents say that the action of the villagers is the latest in a series of incidents where local people have turned against the Taliban in recent weeks.
Some 20 houses of local tribesmen suspected of harbouring Taliban fighters were destroyed, officials say.
The government has encouraged local citizens to set up militias, known as lashkars, to fight the Taliban in the region bordering Afghanistan where al-Qaeda and the Taliban are known to have hideouts.
But these efforts have come at a cost in the past as Taliban militants have retaliated by targeting tribal gatherings, or jirgas, with suicide attacks.
The BBC's M Ilyas Khan in Islamabad says the idea of lashkars had been seen to be futile - particularly when the Taliban were able to punish tribal elders and communities with impunity in areas where government forces were unable to provide adequate security.
But, our correspondent says, the key difference this time is that the present military action in neighbouring Swat appears to have convinced people that the government is serious about countering the Taliban.
The fighting has displaced more than two million people, raising fears of a humanitarian crisis in overstretched camps trying to cope with those forced to leave their homes.