A local police official, Khalid Wazir, said the bombing appeared to target a convoy of security forces passing by the town of Miran Shah in Khyber Pakhtunkhwa province near the Afghan frontier.
The blast damaged nearby shops but the injured were mostly troops, the official added.
No group immediately claimed responsibility for the attack, but the mountainous and isolated area is a former stronghold of the Pakistani Taliban, known as Tehrik-e-Taliban Pakistan or TTP, which is allied with neighboring Afghanistan’s rulers.
Local Taliban have stepped up attacks on security forces in recent weeks after unilaterally ending a monthslong ceasefire with Pakistan’s government last month.
Pakistan has repeatedly complained that Afghanistan’s Taliban rulers have failed to secure the frontier areas and are giving shelter to Pakistani Taliban fighters and leaders across the unruly border. The Pakistani Taliban have been emboldened by the return to power of Afghanistan’s Taliban, who took power in Kabul after the US troop withdrawal last year.