Updated

Pakistan accused international forces in Afghanistan of killing civilians in an unusual cross-border ground and air attack Wednesday that officials warned could undermine cooperation in the war on terror.

In other violence buffeting the country days before the legislature elects a successor to former President Pervez Musharraf, snipers fired on the prime minister's limousine and the army said it killed two dozen militants in a northwestern valley.

Relations between the United States and Pakistan, uneasy allies in the war against international terrorism, are under growing strain due to cross-border attacks, including suspected American missile strikes that killed two senior Al Qaeda operatives this year.

Officials gave differing accounts of Wednesday's pre-dawn raid in the South Waziristan region, part of the tribal belt where officials suspect Usama bin Laden and Al Qaeda No. 2 Ayman al-Zawahri are hiding. It was unclear whether any militant leaders were killed or captured.

Pakistan's military said ground forces from NATO's International Security Assistant Force in Afghanistan were ferried to the raid by two helicopters.

Army spokesman Maj. Gen. Athar Abbas said it was the first incursion into Pakistani territory by foreign forces, who previously limited their attacks on the tribal areas to airstrikes.

He said the strike would undermine Pakistan's efforts to wean away tribes in the region from hardcore militants and could even threaten NATO's major supply lines, which snake through the border region, and Pakistan's ability to maintain military posts along the border.

The Foreign Ministry called the raid "a grave provocation" and "a gross violation of Pakistan's territory." It said a strong diplomatic protest was being lodged over the "immense loss of civilian life."

"Such actions are counterproductive and certainly do not help our joint efforts to fight terrorism," it said. "On the contrary, they undermine the very basis of cooperation and may fuel the fire of hatred and violence that we are trying to extinguish."

1st Lt. Nathan Perry, a spokesman for the U.S.-led coalition in Afghanistan, said it had "no information to give" about the alleged operation, and the U.S. embassy in Islamabad declined to comment. NATO denied dispatching its forces.

"There has been no NATO or ISAF involvement crossing the border into Pakistan," NATO spokesman James Appathurai said.

The governor of North West Frontier Province, the top administrator for the tribal belt, said up to 20 people died, including women and children.

Army spokesman Maj. Murad Khan said 15 people died, including seven civilians. He wouldn't say whether the others were suspected militants.

Habib Khan Wazir, an area resident, said he heard helicopters, then an exchange of fire.

"Later, I saw 15 bodies inside and outside two homes. They had been shot in the head," Wazir said by telephone.

He claimed the dead included women and children and that all were civilians.

"There was darkness at the time when the Americans came and killed our innocent people," Wazir said. "We would have not allowed them to go back alive if they had come to our village in daylight."

Residents said the dead were buried Wednesday.

American officials say Pakistan's tribal regions along the Afghan border have turned into havens for Al Qaeda and Taliban-linked militants involved in attacks on U.S. and NATO forces in Afghanistan.

The U.S. has pushed Pakistan to crack down, and there has been debate in Washington over how far the U.S. can go with its own strikes.

The Associated Press reported last year that U.S. rules of engagement allowed ground forces to go a little over six miles (10 kilometers) into Pakistan when in hot pursuit and when forces were targeted or fired on by the enemy. U.S. rules allow aircraft to go 10 miles (16 kilometers) into Pakistan air space.

The U.S. military and the CIA also operate drone aircraft armed with missiles that prowl the rugged border region.

Pakistani officials say cross-border strikes are a violation of their sovereignty. They plead with U.S. and NATO commanders to share intelligence and allow Pakistani troops to carry out all raids on their territory.

However, U.S. officials recently accused rogue elements within Pakistan's premier intelligence agency of sharing sensitive information with militants.

Relations took a hit earlier this year when Pakistan said coalition aircraft bombed one of its border posts, killing 11 troops.

However, the civilian government — under pressure from Washington — has also taken a tough line against militants, seeking to persuade a skeptical public that security forces are fighting Islamic extremists for Pakistan's sake, not Washington's.

In a mark of the country's precarious stability, snipers fired on the motorcade for Pakistan's prime minister on Wednesday as it drove to the airport to pick him up, striking his car window at least twice, officials said.

Neither the prime minister nor his staff were in the vehicles.

Muslim Khan, a spokesman for the banned militant organization Tahrik-e-Taliban, claimed responsibility and pledged more attacks in retaliation for army operations in tribal areas and the Swat valley.

The attack was the second apparent assassination attempt in Pakistan in quick succession.

Shots were fired last week at a car carrying Lynne Tracy, the top U.S. diplomat in Pakistan's troubled northwest, as she was headed to her office in the city of Peshawar. No one was hurt in that shooting.

Murad, the army spokesman, said security forces killed 25 to 30 militants in an offensive Wednesday against militants in Swat, a former tourist destination were Islamic extremists tried to seized control last year.