About 70-80 terrorists attacked Pakistani check-posts between Tripaman and Inkal Sar in Lower Dir region late Tuesday night.
The Foreign Office in Islamabad on Wednesday summoned the Afghan charge d'affaires and lodged a strong protest over the cross-border attack.
"At least seven terrorists were killed and nine injured as the attack was successfully repulsed by the Pakistan military," the Foreign Office said.
Pakistan asked Afghanistan to take effective steps to stop the use of its territory for repeated cross-border attacks by terrorists fleeing from North Waziristan tribal region, which is home to militants affiliated to Al-Qaeda and the homegrown Tehreek-i-Taliban Pakistan as well as foreign fighters including Uzbeks and Uygurs.
Pakistan would also take up this matter with the Afghan government at a higher level.
It alleges that Taliban chief Maulana Fazlullah, who escaped to Afghanistan in 2009, was behind such attacks.
Afghan-based militants have been often blamed for attacks on Pakistani security posts, leading to souring of diplomatic ties between Islamabad and Kabul.
Pakistan has repeatedly asked Afghan authorities to destroy militant hideouts on its territory.
Many militants are believed to have crossed over to the Afghan side since the Pakistani military launched an all-out operation, named Zarb-i-Azb, on June 15 to flush out foreign and local militants from North Waziristan.
The operation was launched following a brazen attack by TTP on Karachi's International Airport and failure of peace talks between government and Talibam nominated negotiators.
Since the start of the offensive, 570 terrorists had been killed and 98 terrorists hideouts destroyed.
Pakistan army has claimed it had cleared most of the region that was the largest stronghold of terrorists in North Waziristan.
Image used only for representational purposes
Navi Mumbai Airport: Bid deadline extended to Sep 2
10 terrorists among 23 killed as Karachi airport siege ends
Top Al Qaeda commander killed in US drone strike
Pak army kills 120 suspected terrorists in N Waziristan
Rupee ends at over 2-week high of 60.06