The attacker targeted an office inside the Frontier Corps camp in Bannu city of Khyber-Pakhtunkhwa province. Parts of the single-storey building collapsed after the explosion,
Nine bodies had been found so far, officials told the media.
They said they feared more bodies could be buried in the rubble.
The 17 security personnel injured in the attack were taken to a military hospital in Bannu, where officials said several troopers were in critical condition.
Sources said nearly 300 paramilitary troopers were living in the camp, which had several residential barracks. The camp is a base for Frontier Corps personnel deployed
in nearby North Waziristan tribal region, considered a safe haven for Taliban and al-Qaeda elements.
Bannu is located 40 km from Miranshah, the main town in North Waziristan tribal agency.
Footage on television showed most parts of the camp were razed to the ground.
Security personnel dug through the rubble of the office with their hands as they searched for bodies and the injured.
No group claimed responsibility for the attack though officials blamed the local Taliban for the bombing.