"Heavily-armed militants attacked security forces when they had on a routine patrolling at Bara area of Khyber agency," said a spokesman for the paramilitary 'Frontier Corps'.
Nine soldiers died at the scene and three others were injured, the spokesman said, adding the security forces returned fire and killed 16 militants. There was no independent confirmation of the killing of the militants.
Locals said that the militants had launched major attack on a roadside check post of the security forces, inflicting heavy losses on the security forces.
Sources said a group of 30 to 35 militants attacked the security check post with rockets, hand grenades and automatic weapons.
Militants have recently stepped up attacks on security forces in Khyber agency in recent weeks. Khyber agency is the main supply route for North Atlantic Treaty Organisation forces in neighbouring Afghanistan. Militants routinely attack NATO supply trucks in the region.
No group has claimed responsibility for the attack. Tehrik-e-Taliban Pakistan and another militant group Lashkar-e-Islam are active in the area.
The security forces have launched several operations in Khyber agency and cleared most of the areas of the militants but they are still active in several areas.
Militants attack bus near Quetta, kill 13 Shia Muslims
'Better India-Pak trade will be win-win for all'
Taliban seeks Saudi's mediation in peace talks with Pak
Modi's fast political drama: Clerics
We have failed to provide security for Afghan people: Karzai