The militants intruded into Kitkot area of Bajaur Agency late last night. The militants were encircled by Pakistani security forces, the sources said.
According to the latest reports, six militants were killed by the troops. The operation against the militants was continuing, the sources said.
The Pakistani military has said that Taliban elements based in Afghanistan were responsible for a string of recent attacks on border posts.
In one attack in the Dir area, the militants captured and beheaded 17 Pakistani troops.
Pakistani military commanders have raised the issue with NATO commanders in Afghanistan.