The massacre of 16 villagers by a US soldier has triggered angry calls for an immediate American exit from Afghanistan, as Washington tries to negotiate a long-term presence to keep the country from sliding into chaos again.

Just days before Sunday's attack, Kabul and Washington had made significant progress in negotiations on a strategic partnership agreement that would allow American advisers and special forces to stay in Afghanistan after foreign combat troops leave at the end of 2014.

But securing a full deal may be more difficult after the shooting spree in the southern province of Kandahar, which killed mainly women and children.

"This could delay the signing of the strategic partnership agreement," an Afghan Government official said.

Afghanistan's parliament condemned the killings, saying Afghans had run out of patience with the actions of foreign forces and the lack of oversight.

Popular fury over the killing spree, which brought demands that the US withdraw earlier than scheduled, could be exploited by the Taliban to gain new recruits.

Anti-Americanism, which boiled over after copies of the Koran, were inadvertently burned at a Nato base last month is likely to deepen after the Kandahar carnage.

"The Americans said they will leave in 2014. They should leave now so we can live in peace," said Mohammad Fahim, 19, a student. "Even if the Taliban return to power, our elders can work things out with them. The Americans are disrespectful."

The civilian deaths may also force Afghan President Hamid Karzai to harden his stand in the partnership talks to appease a public already critical of his Government's performance.

The partnership agreement, which Washington and Kabul have been discussing for more than a year, will be the framework for US involvement in Afghanistan after foreign combat troops leave at the end of 2014.

Without it, there is a danger civil war could erupt because ill-trained Afghan forces would be unable to keep insurgents at bay.

Meanwhile, the former com-mander of British Forces in Afghanistan warned UK troops could be killed in reprisal attacks. Colonel Richard Kemp said: "Not only are we likely to see protests and possibly American, possibly British, soldiers killed over what happened, but also a very severe weakening of the relationship between many of the people in Afghanistan who were supporting us."

Prime Minister David Cameron said: "This was an absolutely dreadful event and one's heart just goes out to those families in Kandahar who have suffered these appalling losses."

However, he insisted the incident should not trigger a change in strategy for the Nato-led International Security and Assistance Force.

Mr Cameron said: "It is worth remembering why we are in Afghanistan. We are there to train up the Afghan army and police so that country is able to look after its own security and isn't a haven for terrorists."

US President Barack Obama yesterday expressed his "shock and sadness" over the incident.

American military officials have launched an investigation into the killings. They said a service member had been detained in Kandahar.