The clash took place in the Khyber tribal district bordering Afghanistan. “At least eight soldiers died and 22 militants were killed,” Khyber administrator Mutahir Zeb Khan told AFP.
“Militants from Lashkar-e-Islam group attacked our outpost and a gunfight erupted,” Khan said.
Military officials in Peshawar confirmed the attack and casualties.
Lashkar-e-Islam, which is led by warlord Mangal Bagh, is said to be linked to Taliban militants and criminal gangs.
It was not possible to independently verify the official account of the incident as access to the area is restricted by the military.
Some 18,000 people fled their homes in Khyber in October last year amid fears of a fresh onslaught of fighting between the army and militants linked to the Pakistani Taliban.
Seven tribal districts near the Afghan border are rife with homegrown insurgents and are strongholds of Taliban and al Qaeda operatives.
Militants have killed more than 4,800 people across Pakistan since July 2007.