At least seven members of the Pakistani security forces have been killed in a militant attack, local officials say.
They died when a group of about 100 fighters over-ran a checkpoint close to the border with Afghanistan.
The incident happened in Upper Dir, a district of Khyber Pakhtunkhwa, in the north-west of the country.
Local officials said the fighters were wearing military uniforms and crossed into Pakistani territory from Afghanistan on Wednesday morning.
One report suggests that the militants also destroyed schools and blew up a bridge.
Upper Dir lies just outside the border regions known as Pakistan's tribal areas.
But it has also witnessed al-Qaeda and Taliban militant violence, and the Pakistani military has carried out operations there in the past.
Securing the long, porous border that divides Pakistan and Afghanistan has been a major challenge for the two countries as they try to stop insurgents.
Local police official Rahim Gul told the BBC that Wednesday's attack began around noon. Police say that a shootout is still ongoing in Shaltalo town.
The town is located in a remote mountainous corner of Upper Dir district, near the border with Kunar province of Afghanistan.
Witnesses said heavy contingents of army and paramilitary troops have entered the area and helicopter gunships have been seen pounding suspected militant positions.
At least 13 Pakistani security troops were killed in a similar cross-border raid by Taliban in the neighbouring Lower Dir district two months ago.
The attack is the latest bloodshed following the death of Osama Bin Laden last month in Pakistan.
The Pakistani Taliban and affiliated groups have vowed to carry out attacks to avenge his death. However correspondents say that the latest violence is much more more likely to be a reaction to ongoing Pakistani military offensives against insurgents along the border.
The US has praised these operations - carried out primarily in the semi-autonomous tribal areas - while also urging Islamabad to take similar action in the North Waziristan tribal region, the primary haven for militant groups that attack American and Nato forces across the border in Afghanistan.