Pressure is mounting on Pakistan to tighten its porous Afghan border
Afghanistan's ambassador to Pakistan has been summoned to the foreign ministry to receive a formal protest over remarks by President Hamid Karzai.
Mr Karzai said on Sunday that Afghanistan had the right to send troops across the border to chase militants taking shelter in Pakistan.
The Afghan ambassador in Islamabad was given a "strong protest" over the comments, Pakistan says.
The US says cross-border raids from Pakistan are a growing problem.
Pakistani officials would not elaborate on what was said when the Afghan ambassador, Mohammad Anwar Anwarzai, received the protest.
In outspoken remarks on Sunday, President Karzai said: "Afghanistan has the right of self-defence. When [militants] cross the territory from Pakistan to come and kill Afghans and to kill coalition troops it exactly gives us the right to go back and do the same."
He was speaking two days after Taleban fighters attacked an Afghan jail in the southern city of Kandahar, freeing some 900 inmates, including 350 Taleban members.
On Monday the Taleban said they had taken control of a number of villages in Arghandab district near Kandahar city.
The Afghan ministry of defence has denied that the insurgents have made any gains in the area. But the district's police chief said three villages had been taken over.
The Afghan president has long pleaded for Pakistan and international forces to confront militants in Pakistan but has never before threatened to send troops over the border.
The US-led coalition said 35 suspected Taleban militants were killed on Saturday and Sunday in clashes in the southern provinces of Zabul and Helmand.
Mr Karzai warned he was prepared to seek out Taleban leaders wherever they were, specifically naming Baitullah Mehsud, who is based in South Waziristan, Pakistan.
President Hamid Karzai says his country has a right to defend itself
"Baitullah Mehsud should know that we will go after him now and hit him in his house," Mr Karzai said, adding that Taleban leader Mullah Omar could expect the same.
Correspondents say it is the strongest language used yet by Mr Karzai regarding his neighbour.
Pakistani Foreign Minister Mehmood Qureshi said it was "regrettable that such a statement was made at a time when the two sides had agreed to close the ranks in the fight against terrorism".
He said that he wanted to make it "absolutely clear" that his country would defend its territorial sovereignty.
"In my view, the only way to win the war against terrorism and extremism is by showing full respect to the territorial sovereignty and non interference in each others' internal affairs," he said.
"Since the two countries are faced with a common enemy it is all the more necessary that Afghanistan refrain from making irresponsible threatening statements," he said.
Prime Minister Yousuf Raza Gilani said that the border between their two countries was too long to police.
"Neither do we interfere in anyone else's matters, nor will we allow anyone to interfere in our territorial limits and our affairs," Mr Gilani told the Associated Press news agency.
"We want a stable Afghanistan. It is in our interest. How can we go to destabilise our brotherly country?"
In the wake of Friday's jail break, some 20 escapees from the Kandahar prison have been recaptured in the manhunt by Afghan and international troops, according to Afghan officials.
A former Taleban stronghold, Kandahar is one of the key battlegrounds in the insurgency against Afghanistan's government and troops from Nato and a US-led coalition.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.