Sixteen Afghans including women and children were killed in their homes by a US soldier in a pre-dawn rampage Sunday, plunging relations between the two countries into a new crisis.
Afghan President Hamid Karzai condemned the slaughter as "unforgivable".
"When Afghan people are killed deliberately by US forces this action is murder and terror and an unforgivable action," Karzai said in statement.
An American soldier entered the homes of civilians in the southern Kandahar province and killed 16 people including nine children and three women, the statement said.
"The government and the people of Afghanistan demand an explanation from the United States government of this incident," Karzai said.
NATO's International Security Assistance Force said it had arrested a soldier over the incident, and the commander, General John Allen, condemned "this deeply appalling incident".
He also vowed to hold "fully accountable" anyone found responsible for the killing spree.
"I cannot explain the motivation behind such callous acts, but they were in no way part of authorised ISAF military activity," his deputy, Lt. Gen. Adrian Bradshaw, said in a statement as the US rushed to offer condolences.
"The United States extends deepest condolences to the families of today's tragic shooting and we're saddened by this violent act against our Afghan friends," a State Department spokeswoman said.
The US embassy in Kabul sent out an alert to its citizens in Afghanistan warning that as a result of the shooting "there is a risk of anti-American feelings and protests in coming days".
An AFP reporter at the scene of the killings counted the bodies of 16 people, including women and children. In one house, an elderly woman screamed: "May God kill the only son of Karzai, so he feels what we feel."
Western sources said the rampage began after a US soldier walked off his base in the early hours of Sunday morning, apparently heavily-armed and carrying night-vision equipment.
He was arrested outside the base after the shooting by members of the Afghan National Army, the army corps commander in southern Afghanistan, Abdul Hameed, told AFP.
The massacre was the latest in a series of incidents that have badly frayed US-Afghan relations, complicating negotiations on a strategic partnership agreement between the two countries for when US combat operations end in 2014.
The treaty 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.
In Iraq, Washington abandoned its pursuit of a strategic partnership deal and pulled out all its troops, leaving no residual force, after failing to get Baghdad to grant its soldiers legal immunity.
Relations plunged to an all-time low last month after the burning of Korans at a military base near the Afghan capital, sparking anti-US protests in which some 40 people died and forcing US President Barack Obama to apologise.
During the protests, six American soldiers were killed when Afghan colleagues turned their weapons against them.
But there was no word on what might have motivated the soldier's actions in Kandahar.
An Afghan government official, who described Karzai as "very angry" over the incident, said the president had dispatched the army chief of staff to head an investigation.
Afghan resentment of US forces has also been provoked by a video posted online in January showing US Marines urinating on the bloodied corpses of slain Afghan insurgents -- an incident condemned by the Pentagon.
And in November, the ringleader of an American military "kill team" charged with murder for shooting civilians for sport was found guilty and sentenced to life in prison by a military panel.
Kandahar is a stronghold of Taliban insurgents fighting to oust Karzai's government, which is supported by some 130,000 US-led NATO troops.