US fears reprisals after Afghan massacre in Kandahar
US troops in Afghanistan have been placed on alert following the killings of 16 Afghan civilians by a US soldier.
US officials warned of reprisals after the soldier went on a rampage in villages near a base in Kandahar. Nine children were among those killed.
President Barack Obama phoned his Afghan counterpart Hamid Karzai to express condolences. But Mr Karzai has said the massacre is "unforgivable".
And Taliban militants have vowed to avenge the deaths.
US Defence Secretary Leon Panetta has said a full investigation is under way.
The soldier, believed to be a staff sergeant, is reported to have walked off his base at around 03:00 Sunday (22:30 GMT Saturday).
In the villages of Alkozai and Najeeban, about 500m (1,640ft) from the base, he reportedly broke into three homes.
At one house in Najeeban, 11 people were found shot dead, and some of their bodies set alight. At least three of the child victims are reported to have been killed by a single shot to the head.
The US military said reports indicated that the soldier returned to his base after the shootings and turned himself in. His motives are unclear - there is speculation that he might have been drunk or suffered a mental breakdown. But officers are worried that the attack might have been planned.
The soldier is being detained in Kandahar and the military is treating at least five people wounded in the attacks, officials said.
The detained soldier has not been identified, although US officials quoted by the Associated Press news agency said he was from Joint Base Lewis-McChord in Washington state, 38 years old, married with two children, and had served three tours in Iraq and was on his first deployment in Afghanistan.
The killings come amid already high anti-US sentiment in Afghanistan following the burning of Korans at a Nato base in Kabul last month.
US officials have repeatedly apologised for the incident but they failed to quell a series of protests and attacks that killed at least 30 people and six US troops.
The BBC's Bilal Sarwary in Kabul says the latest incident has damaged already fragile relations between Kabul and Washington.
He says the Taliban is using the shooting as a propaganda victory, placing President Karzai in a difficult position.
Angry tribal elders are now demanding an immediate end to US night raids on Afghan homes.
Afghan MPs passed a strong resolution to condemn the killing and demanded an open trial on Afghan soil. However, Afghanistan has signed an agreement with Nato that foreign soldiers should be tried in their own countries.
The killings could further fuel calls for a more rapid withdrawal of US troops from Afghanistan.
Meanwhile, US personnel in Afghanistan were warned of possible reprisal attacks.
"The US Embassy in Kabul alerts US citizens in Afghanistan that as a result of a tragic shooting incident in Kandahar province involving a US service member, there is a risk of anti-American feelings and protests in coming days, especially in the eastern and southern provinces,"the embassy said in an emergency statement on its website.
The US embassy in Kabul is restricting the movements of staff in southern Afghanistan until at least 17:00 local time on Monday.
In a statementreleased by the White House on Sunday, President Obama said: "This incident is tragic and shocking, and does not represent the exceptional character of our military and the respect that the United States has for the people of Afghanistan."
Our correspondent says Afghan officials also fear there will be violent demonstrations and have deployed extra police and troops around Kandahar.
President Karzai described the killings as the "intentional killing of innocent civilians" and said they could "not be forgiven".
The BBC's Quentin Sommerville in Kabul says this is the first time Afghan civilians have been targeted by foreign soldiers in this way.
However, one US soldier was convicted last year on three counts of premeditated murder after leading a rogue "kill team" in Afghanistan.
A recent poll by ABC News and The Washington Post found 60% of Americans believe the war in Afghanistan is not worth its costs. Nearly the same number advocated an early US pullout from the country.
On a previously unannounced trip to Afghanistan, Germany's Chancellor Angela Merkel said she could not be sure German troops would withdraw by 2014 as originally planned, but they were working towards that target.