The attack comes as relations between the United States and Pakistan, its ally in the war on militancy, are already badly strained following the killing of al Qaeda leader Osama bin Laden by U.S. special forces in a secret raid on the Pakistani garrison town of Abbottabad in May.
Pakistan called that raid a flagrant violation of its sovereignty.
The Foreign Office condemned Saturday's attack.
"Prime Minister Yusuf Raza Gilani has condemned in the strongest terms the NATO/ISAF attack on the Pakistani post," ministry spokeswoman Tehmina Janjua said in a statement. "On his direction, the matter is being taken (up) by the foreign ministry in the strongest terms with NATO and the U.S."
Two military officials said that up to 28 troops had been killed and 11 wounded in the attack on the Salala checkpoint, about 2.5 km (1.5 miles) from the Afghan border.
The attack took place around 2 a.m. (2100 GMT) in the Baizai area of Mohmand, where Pakistani troops are fighting Taliban militants.
A senior Pakistani military officer said efforts were under way to bring the bodies of the slain soldiers to Ghalanai, the headquarters of Mohmand tribal region.
"The latest attack by NATO forces on our post will have serious repercussions as they without any reasons attacked on our post and killed soldiers asleep," he said, requesting anonymity because he was not authorized to talk to the media.
About 40 Pakistani army troops were stationed at the outpost, military sources said. Two officers were reported among the dead.
NATO supply trucks and fuel tankers bound for Afghanistan were stopped at Jamrud town in the Khyber tribal region near the city of Peshawar hours after the raid, officials said.
"We have halted the supplies and some 40 tankers and trucks have been returned from the check post in Jamrud," Mutahir Zeb, a senior government official, told Reuters.
Another official said the supplies had been stopped for security reasons.
"There is possibility of attacks on NATO supplies passing through the volatile Khyber tribal region, therefore we sent them back toward Peshawar to remain safe," he said.
Pakistan is a vital land route for 49 percent of NATO's supplies to its troops in Afghanistan, a NATO spokesman said.
A spokesman for the NATO-led International Security Assistance Force in Kabul said the coalition there was aware of "an incident" and was gathering more information.
Reflecting the confusion of war in an ill-defined border area, an Afghan border police official, Edrees Momand, said joint Afghan-NATO troops near the outpost Saturday morning had detained several militants.
"I am not aware of the casualties on the other side of the border but those we have detained aren't Afghan Taliban," he said, implying they were Pakistani Taliban operating in Afghanistan.
The Afghanistan-Pakistan border is often poorly marked, and differs between maps by up to five miles in some places.
The incident occurred a day after U.S. General John Allen met Pakistani Army Chief of Army Staff General Ashfaq Pervez Kayani to discuss border control and enhanced cooperation.
This raid is the largest and most serious incident of its kind. A similar incident on Sept 30, 2009, which killed two Pakistani troops, led to the closure of one of NATO's supply routes through Pakistan for 10 days.
NATO apologized for that incident, which it said happened when NATO gunships mistook warning shots by the Pakistani forces for a militant attack.
The attack is expected to further worsen U.S.-Pakistan relations, already at one of their lowest points in history, following a tumultuous year that saw the bin Laden raid, the jailing of a CIA contractor, and U.S. accusations that Pakistan backed a militant attack on the U.S. Embassy in Kabul.
An increase in U.S. drone strikes on militants in the last few years has also irritated Islamabad, which says the campaign kills more Pakistani civilians in the border area than activists. Washington disputes that, but declines to discuss the drone campaign in detail.
"This is an attack on Pakistan's territorial sovereignty," said Masood Kasur, the governor of Pakistan's northwestern Khyber-Pakhtunkhwa province.
"Such cross-border attacks cannot be tolerated any more. The government will take up this matter at the highest level and it will be investigated."