"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.

Washington offered condolences to the families of the victims.

"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.

"Our thoughts and prayers are with the families." The incident occurred early yesterday when a US soldier walked out of his base in Kandahar and began shooting villagers in their homes, Western and Afghan sources said.

The rampage 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.

US General John Allen, who commands US and NATO forces in Afghanistan, will call President Hamid Karzai shortly to discuss the shooting.

The shooting could deepen strife between US forces and their Afghan hosts just as weeks of violence set off by the burning of Muslim holy books at a US base had started to die down. The burnings sparked violent protests and attacks that killed some 30 people. Six US service members have been killed in attacks by their Afghan colleagues since the Qur'an burnings came to light.

NATO officials apologized for yesterday's shootings but did not confirm that anyone was killed, referring instead to reports of deaths.

"I wish to convey my profound regrets and dismay at the actions apparently taken by one coalition member in Kandahar province, said a statement from Lt. Gen. Adrian Bradshaw, the deputy commander of NATO forces in Afghanistan.

"One of our soldiers is reported to have killed and injured a number of civilians in villages adjacent to his base. I cannot explain the motivation behind such callous acts, but they were in no way part of authorized ISAF military activity," he said, using the abbreviation for NATO's International Security Assistance Force.

A news photographer saw 16 bodies between the two villages caught up in the shooting. Some of the bodies had been burned, while others were covered with blankets. A young boy partially wrapped in a blanket was in the back of a minibus, dried blood crusted on his face and pooled in his ear. His loose-fitting brown pants were partly burned, revealing a leg charred by fire.

Villagers packed inside the minibus looked on with concern as a woman spoke to reporters. She pulled back a blanket to reveal the body of a smaller child wearing what appeared to be red pajamas. A third dead child lay amid a pile of green blankets in the bed of a truck.

Afghan officials and residents said 16 people were killed, but there was no way to immediately reconcile the death tolls.

NATO spokesman Justin Brockhoff said a US service member had been detained at a NATO base as the alleged shooter. The casualties were evacuated to NATO medical facilities, he added.

The attack took place in two villages in the Panjwai district of southern Kandahar province. The villages - Balandi and Alkozai - are about 500 yards (meters) away from a US base. The shooting started around 3 a.m., said Asadullah Khalid, the government representative for southern Afghanistan and a member of the delegation that went to investigate the incident.

A resident of the village of Alkozai, Abdul Baqi, said that, based on accounts of his neighbors, the American gunman went into three different houses and opened fire.

"When it was happening in the middle of the night, we were inside our houses. I heard gunshots and then silence and then gunshots again," Baqi said. There was no immediate verification of his account.

Khalid, the government representative, said he had tallied 16 dead, a number that matched accounts from villagers.

Twelve of the dead were from Balandi, said Samad Khan, a farmer who lost all 11 members of his family, including women and children. Khan was away from the village when the incident occurred and returned to find his family members shot and burned. One of his neighbors was also killed, he said.

"This is an anti-human and anti-Islamic act," said Khan. "Nobody is allowed in any religion in the world to kill children and women." Khan demanded that Afghan president punish the American shooter.

"Otherwise we will make a decision," said Khan. "He should be handed over to us." Residents in Alkozai village also demanded that Karzai punish the American or hand him over to the villagers. The four people killed in the village were all from one family, said a female relative who was shouting in anger. She did not give her name because of the conservative nature of local society.