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.
bbc.com