Shafiullah Khan says two soldiers were wounded in the attack today, 20 kilometres south of the main northwest city of Peshawar. Two vehicles were destroyed.
Khan says the soldiers retaliated, killing four militants.
No one has claimed responsibility for the attack, but suspicion will likely fall on the Pakistani Taliban.
The Taliban have been waging an insurgency against the Pakistani government for years that has killed thousands of security personnel and civilians.