The two officials say they were not told the reason for the order at the Torkham border post. However, it comes after threats by Pakistani officials to stop providing protection to NATO convoys if the military alliance's choppers hit Pakistani targets again.

A NATO official in Afghanistan confirmed there was an attack in the border area close to the Upper Orakzai region, but gave no further details saying the incident was being investigated. He and the Pakistani security officers declined to give their names, citing the sensitivity of the incident.

The attack was likely to worsen ties between Pakistan and NATO-led forces in Afghanistan at a crucial time in the 9-year war.

Relations have been tense since NATO helicopters last weekend opened fire on targets across the border, killing several alleged insurgents. Those incidents were protested by the Pakistan government.

Pakistani officials differed on the exact location of the incident, saying it either took place in Upper Kurram or Upper Orakzai. The remote districts neighbor each other and there is no marked border between the two.

The dead men were from a paramilitary force tasked with safeguarding the border, they said. Their bodies had been taken to the region's largest town of Parachinar, said one of them.

Pakistan has a complicated alliance with the United States and NATO that is often subject to tensions.

Pakistan has to balance its support for Western forces in Afghanistan with the intense anti-U.S. feelings of much of its population. Opinion polls show many people regard the United States as an enemy, and conspiracy theories stating U.S. troops are poised to attack Pakistan and take over its nuclear weapons are common.