The war in Afghanistan spilled over on to Pakistani territory for the first time yesterday when heavily armed commandos, believed to be US Special Forces, landed by helicopter and attacked three houses in a village close to a known Taliban and al-Qaida stronghold.

The surprise attack on Jala Khel was launched in early morning darkness and killed between seven and 20 people, according to a range of reports from the remote Angoor Adda region of South Waziristan. The village is situated less than one mile from the Afghan border.

Local residents were quoted as saying that most of the dead were civilians and included women and children. It was not known whether any Taliban or al-Qaida militants or western forces were among the dead.

Furious official Pakistani condemnation of the attack followed swiftly, amid growing concern that the Nato-led war against the Taliban in Afghanistan could spread to Pakistan, sparking a region-wide conflagration.

Owais Ahmed Ghanisaid, the governor of North-West Frontier province, adjoining South Waziristan, said 20 people had died and called for retaliation. "This is a direct assault on the sovereignty of Pakistan and the people of Pakistan expect that the armed forces ... would rise to defend the sovereignty of the country and give a befitting reply," he said.

The foreign ministry in Islamabad termed the incursion "a gross violation of Pakistan's territory" and a "grave provocation" which, it said, had resulted in "immense" loss of civilian life.

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

"This is a very alarming and very dangerous development," said a former senior Pakistani official. "We have absolutely been telling them [the US] not to do this but they ignored us."

US and Nato commanders say Taliban and al-Qaida fighters use the unruly, semi-autonomous tribal areas of Pakistan to stage attacks on coalition forces inside Afghanistan and create "safe havens" where they are immune from attack. Nato and civilian casualties in Afghanistan have reached record levels in the past 12 months in the face of a spreading Taliban offensive.

US forces have used missile-carrying drones - unmanned aerial vehicles - to attack militant targets inside Pakistan in the past. But yesterday's assault, involving up to three helicopters and infantry commandos, marked the first time the fight has been taken directly to the enemy on Pakistani soil.

Major-General Athar Abbas, a spokesman for the Pakistan army, said Nato's International Security Assistance Force (Isaf) had carried out the raid. "Two helicopters of Isaf landed very early in the morning and conducted a raid on a compound there. As per our report, seven civilians were killed in this raid."

But a Nato spokesman denied involvement. "There has been no Nato or Isaf involvement crossing the border into Pakistan," a Nato spokesman, James Appathurai, said. There were unconfirmed reports that the incursion was carried out by US Special Forces, which are not under Isaf command and can operate independently. A US military spokesman at the Bagram base near Kabul did not deny an attack had occurred but declined to comment.

Tensions between Pakistan's new civilian government and the US have been running high following American accusations that rogue elements in Pakistan's top spy agency, the Inter-Services Intelligence agency, were feeding classified information on coalition troops to Taliban fighters. Washington has also repeatedly accused Islamabad of failing to do enough to curb militant activity.

The strains have been exacerbated by a political crisis in Pakistan following last month's forced resignation of President Pervez Musharraf and the collapse of a power-sharing agreement between the ruling Pakistan People's party (PPP) and Nawaz Sharif, a former prime minister. An election to find a replacement for Musharraf is scheduled for Saturday, with the PPP chairman, Asif Ali Zardari, Benazir Bhutto's widower, expected to win.

In a further sign of instability, militants opened fire yesterday on prime minister Yousaf Raza Gilani's car, in an apparent assassination attempt, near Islamabad. The assailants, firing from a roadside embankment, hit the driver's side window twice. Gilani was not in the car at the time.

Today he was due to meet David Cameron, the Conservative leader, who is visiting Pakistan.

• Watch John D McHugh's video on the struggle for power and influence in the Afghanistan-Pakistan border region