A US soldier is being questioned following the shooting of 16 civilians, including nine children, in southern Afghanistan.
The incident, one of the worst of its kind since the US-led invasion of Afghanistan in 2001, quickly inflamed the severely-strained relations between Washington and Kabul.
The US Embassy in Kabul said anti-US reprisals were possible following the killings, which come weeks after US soldiers burned copies of the Koran at a NATO base, triggering widespread anti-Western protests in which at least 30 people died.
Neighbours and relatives of the dead said they had seen a group of US soldiers arrive at their village in Kandahar's Panjwayi district at about 2am, enter homes and open fire.
A senior US defence official in Washington rejected witness accounts that several apparently drunk soldiers were involved.
"Based on the preliminary information we have this account is flatly wrong," the official said. "We believe one US service member acted alone, not a group of US soldiers."
US President Barack Obama said he was deeply saddened.
"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," Mr Obama said in a statement.
Afghan President Hamid Karzai condemned the rampage as "intentional murders" and demanded an explanation from the US. His office said the dead included nine children and three women.
Afghan officials gave varying accounts of the number of shooters involved in the incident. Mr Karzai's office released a statement quoting a villager as saying: "American soldiers woke my family up and shot them in the face."
Minister of Border and Tribal Affairs Asadullah Khalid said a US soldier had burst into three homes near his base in the middle of the night, killing a total of 16 people including 11 people in the first house.
A spokesman for NATO's International Security Assistance Force (ISAF) said the US soldier "walked back to the base and turned himself into US Forces this morning", adding there had been no military operations taking place in the area when the incident occurred.
Panjwayi district is about 35 km west of the provincial capital Kandahar city. The district is considered the spiritual home of the Taliban and has been a hive of insurgent activity in recent years.