* Pakistan says Afghan-based militants launched raid into Pakistan
* U.S., Pakistan trying to repair strained ties
* NATO commander likely to visit Pakistan on June 27 (Adds NATO commander visit to Pakistan)
By Jibran Ahmad
PESHAWAR, Pakistan, June 25 (Reuters) - Pakistan protested to NATO and the Afghan military on Monday, accusing them of failing to act against militant safe havens in Afghanistan after a cross-border attack killed 13 Pakistani troops, a military official said.
The move is likely to intensify tension between Islamabad and Washington, just when they are trying to repair a rift caused by events such as a cross-border NATO air attack last November which killed 24 Pakistani soldiers.
In Sunday's raid, more than 100 militants based in Afghanistan's Kunar province entered Pakistan and attacked a military patrol, the military official said.
Fourteen militants and six soldiers were killed in the clash, seven soldiers were beheaded by militants afterwards and four soldiers are still missing, the official said.
The Foreign Ministry said the Afghan deputy head of mission in Islamabad was summoned and presented with a "strong protest".
The Malakand faction of the Pakistan Taliban claimed responsibility and threatened more attacks.
"Our fight will continue until the establishment of sharia law in Pakistan ... We will fight whoever tries to stand in our way," Sirajuddin Ahmad, the faction's spokesman, told Reuters.
Ahmad said the group had killed 17 Pakistani soldiers in Sunday's attack.
The NATO-led International Security Assistance Force (ISAF) in Afghanistan said it was aware of the report, but had no information.
The commander of NATO forces in Afghanistan, U.S. General John Allen, is likely to visit Pakistan on June 27, the Pakistan military said in a statement on Monday, a trip that could focus on improving tense relations between the two sides.
"The interaction will focus on reviewing the progress made in (the) implementation of recently evolved border coordination measures," the military said.
Fazlullah Wahidi, governor of Kumar province, said the militants were based in Pakistan, not Afghanistan. "We don't have any information about militants crossing the border from Afghanistan to attack troops in Pakistan," he told Reuters.
The Malakand, or Swat, Taliban are led by Maulvi Fazlullah, who was the Pakistan Taliban leader in the Swat Valley, about 100 miles (160 km) northwest of Islamabad, before a 2009 army offensive forced him to flee.
Also known as FM Mullah for his fiery radio broadcasts, he regrouped in Afghanistan and established strongholds there, according to the Pakistan military.
He resurfaced as a threat last year, when his fighters carried out cross-border raids that killed around 100 members of the Pakistani security forces.
Pakistan wants Afghan and NATO forces to act against Afghan-based militants who cross the border to attack Pakistani forces and civilians - while the United States calls on Pakistan to stop providing safe havens for militants fighting NATO forces backing Afghanistan's government against the Taliban.
U.S. Defense Secretary Leon Panetta said earlier this month that Washington's patience was running out, but tempered those remarks in an interview with Reuters last week when he said both sides had to work at improving relations.
Islamabad rejects U.S. suggestions that it is allowing insurgents to operate in Pakistan, saying it will not allow its territory to be used against any country. (Additional reporting by Sheree Sardar, and Hamid Shalizi in KABUL; Writing by Qasim Nauman; Editing by Tim Pearce)