Two Pakistani soldiers were slightly wounded Thursday when militants from Afghanistan attacked a border post, sparking a shootout in which four "terrorists" were killed, the Pakistani military said.
It was the latest incident of cross-border violence against a backdrop of worsening relations between the neighbours, who accuse each other of responsibility for Taliban violence plaguing both countries.
Pakistan said the attack began at 5:30 am (0030 GMT) and lasted until 7 am in the Alizai sector of the tribal district of Kurram on the border with eastern Afghanistan.
"Terrorists carried out fire raid from across the border followed by a physical attack on Bhittai post," it said in a statement.
"The post fought well, repulsed the attack and killed four terrorists," it said, adding that two Pakistani soldiers received minor injuries.
It did not say how many militants were involved in the raid.
Afghanistan and Pakistan blame each other for violence by Islamist militants on both sides of their 2,400-kilometre (1,500-mile) border, known as the Durand Line.
In recent months shelling across the mountain frontier, which militants can easily penetrate, has raised tensions.
Kabul last week accused Islamabad of wrecking efforts to end a bloody, 11-year Afghan Taliban insurgency by imposing "impossible" preconditions on any further discussions.
Pakistan, which backed Afghanistan's 1996-2001 Taliban regime, is seen as having a crucial role in negotiating a political settlement with the Islamist extremist leaders who shelter in Pakistan's border districts.