ISLAMABAD, Pakistan — President Hamid Karzai threatened Sunday to send Afghan soldiers across the border into Pakistan to fight militant groups operating in the border areas to attack Afghanistan. His comments, made at a news conference in Kabul, Afghanistan, are likely to worsen tensions between the countries, just days after U.S. forces in Afghanistan killed 11 Pakistani soldiers on the border while pursuing militants.

"If these people in Pakistan give themselves the right to come and fight in Afghanistan, as was continuing for the last 30 years, so Afghanistan has the right to cross the border and destroy terrorist nests, spying, extremism and killing, in order to defend itself, its schools, its peoples and its life," Karzai said.

Karzai repeated Sunday that he regarded the Pakistani government as a friendly government, but he urged it to join Afghanistan and the foreign countries assisting Afghanistan, to fight those who want to destabilize both countries, and to "cut the hand" that is feeding the militants.

The prime minister of Pakistan, Yousuf Raza Gilani, said the border was too long to prevent people from crossing, "even if Pakistan puts its entire army along the border."

Karzai named several militant leaders, including Baitullah Mehsud, a Pakistani who has sent scores of fighters and suicide bombers to Afghanistan, and Maulana Fazlullah, a firebrand militant leader from the Swat Valley. Both men have negotiated recent peace deals with the Pakistani government but vowed to continue waging jihad in Afghanistan.

The president also taunted the leader of the Afghan Taliban, Mullah Muhammad Omar, calling him a Pakistani since he has been based in this country since fleeing Afghanistan in 2001.

Karzai's comments came two days after Taliban fighters assaulted the main prison in the southern Afghan city of Kandahar, blowing up the mud walls, killing 15 guards and freeing about 1,200 inmates.

Karzai says Pakistan has been giving sanctuary to militants for several years, and his frustration has grown as the threat has grown. He has often accused the premier Pakistani intelligence agency, Inter-Services Intelligence, of training and assisting militant groups, to undermine his government and maintain a friendly proxy force for the day that U.S. and NATO troops withdraw from Afghanistan.

In southern Afghanistan, Karzai said, British commanders reported that 70 percent of the Taliban fighters killed in recent fighting in the Garmser district were from Pakistan, and 60 percent were Pakistanis.