The incident took place when security checkpoint in Ferozkhel area of Orakzai district was attacked by atleast dozens of militants, Major Fazalur Rehman, a spokesman for the paramilitary Frontier Corps.
"Five security personnel, including a lieutenant colonel, were martyred while 16 were wounded. Twenty-one terrorists died," Rehman said.
The attack came a day after the 40 Taliban rebels in Orakzai were killed in artillery and airstrikes as part of the ongoing Pakistan offensive against Taliban and al-Qaeda fighters, who are seeking refuge from other army offensives in neighbouring districts.
Most of the soldiers killed in the attacked belong to the Frontier Corps, which is carrying out operation against Taliban militants in seven districts of the tribal region.