US President Barack Obama has said that a deadly shooting rampage by a US soldier in Afghanistan was another reason for moving ahead with plans to withdraw American forces from that country.

"It makes me more determined to make sure we're getting our troops home," Mr Obama said in an interview with KDKA, a CBS affiliate in Pittsburgh.

"It's time. It's been a decade, and, frankly, now that we've gotten bin Laden, now that we've weakened al-Qaeda, we're in a stronger position to transition than we would have been two or three years ago," he added.

However Mr Obama also said he did not think there should be a "rush to the exits" and that the drawdown must be carried out in a responsible way.

Mr Obama will host NATO leaders for a summit in May that will focus on defining plans for gradually trimming Western forces and putting Afghan troops in charge of security.

Most Western forces are due to be gone from Afghanistan by the end of 2014.

Mr Obama was pressed in a separate interview with WFTV, an ABC affiliate in Orlando, on whether there were parallels between the killing of 16 Afghan villagers and the notorious 1968 My Lai massacre of the Vietnam War.

"It's not comparable," he said.

"It appeared you had a lone gunman who acted on his own," he said of the Afghanistan incident.

"In no way is this representative of the enormous sacrifices that our men and women have made in Afghanistan."

Earlier the Taliban vowed revenge for the soldier's killing spree.

The US soldier walked off his base, heavily armed and with night vision equipment, and broke into three village homes before dawn yesterday. Women and children were among the dead.

The attack is the latest in a series of actions by US troops that has provoked outrage in Afghanistan.

It comes weeks after the burning of Korans at a US base provoked riots that killed 40 people.

The Taliban threatened to take revenge against "sick-minded American savages ... for every single martyr".

The statement on its website came after the US embassy urged its citizens to take extra precautions. It warned against "a risk of anti-American feelings and protests in coming days especially in eastern and southern provinces".

A soldier has been detained. The US has offered condolences to the families and pledged that action will be taken against anyone found guilty.

Yesterday's massacre poses an acute test of the US-Afghan alliance. The two countries are pursuing difficult talks on securing a strategic pact to govern their partnership once foreign combat troops leave Afghanistan in 2014.

The proposed strategic pact would likely cover the legal status of any US troops remaining in Afghanistan to help Kabul with intelligence, air power and logistics in the fight against Taliban insurgents.

Mr Karzai reacted with anger to what he called the deliberate and unforgivable killings in Kandahar.

"When Afghan people are killed deliberately by US forces, this action is murder and terror and an unforgivable action," he said.