A suicide car-bomber rammed a Pakistani military convoy killing 25 soldiers and police.
Two civilians were also among the dead. Police said around 65 people were wounded.
Pakistani Taliban has claimed responsibility for the attack near Kohat, 190km west of Islamabad.
A spokesman for Pakistani Taliban chief Baitullah Mehsud said militants would continue its attacks on security forces.
President Asif Ali Zardari told aid donors yesterday he would step up the fight against militants and said defeat for Pakistan would be a defeat for the world.