A security official said that 12 other militants were wounded in clashes with security forces.
According to security officials, militants ambushed a security forces post.
The forces returned fire and killed 17 militants.
Six foreigners were also among those killed in skirmish occurred late Tuesday in a remote area of the tribal agency, the official added.
The official didn't provide any further information on causalities from the military side.