Officials said six militants were killed in the incident on Sunday.
The militants were killed after crossing into Sabir Killey village in the Soni Darr area of Upper Dir district and one of the officials told AFP that the "firefight continued late into the night".
Another official said there were reports that "hundreds of militants" were gathering in Afghanistan's eastern province of Kunar and might try to infiltrate again.
"Authorities have alerted local lashkars amid fears of a bigger clash," he told AFP on condition of anonymity.
Intelligence officials say the attackers are loyalists of Pakistani cleric Maulana Fazlullah, who fled into Afghanistan when the army recaptured the Swat valley after a two-year Taliban insurgency ended in 2009.
Swat neighbours Upper Dir, which is a key transit route between Afghanistan and Pakistan.
The valley was once a popular tourism destination and unlike the semi-autonomous tribal belt on the Afghan border, lies just 100 kilometres from Islamabad.
The Taliban released a video showing severed heads of 17 Pakistani soldiers who they said were killed in a similar cross-border attack on a check post in Soni Darr on June 24.
A senior official confirmed that all 17 in the video were security personnel.
COMMENTS (6)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
Out of all the trolls, the Afghans are the worst. They hate everyone.
Pushtoons, please do not shed blood of your own brothers in the name of nationality, religion, and power. Please don't do this.
Lets have a surveillance of their activities in advance, and keep the jets ready to bomb them the moment they try to launch an attach from the safe heavens of the border provinces.of Afghanistan.
Is killing them enough? I'd love to see bearded heads hanging all along swat valley, upper/lower dir and elsewhere. Why just simply kill em?
Nuke them
So these assets are now at your door steps!! Welcome to the reality that the world has been warning you about for past decade !