A security forces patrolling party killed the militants after over a 30-minute gun battle in Dir district of Khyber Pakhtunkhwa province.
About 15-20 terrorists were attacked by the patrolling party near Pak-Afghan border at 10 pm, security sources said.
In the heavy exchange of gunfire 12 militants were killed while two soldiers were injured, they said.
A few days back Maj Gen Sanaullah Khan, commander Swat forces, was killed in an IED blast in the Khyber Pakhtunkhwa province.