The operation by the security forces and the 'lashkar' was launched in Salarzai area of Bajaur Agency after militants crossed over from Afghanistan and attacked the border village of Batwar, security officials told the media.
Fifteen militants were arrested during the operation.
Two members of the militia and a security personnel were injured in the clashes.
A number of militant hideouts were destroyed in shelling by gunship helicopters.
The same village was attacked by militants based in Afghanistan last week.
At that time, the security forces retaliated but the militants managed to escape, officials said.