KABUL, Afghanistan — A U.S. soldier killed 16 Afghan civilians on Sunday, including three women and nine children, in an unprovoked attack in southern Kandahar province, Afghan officials said.

Five other people were wounded in the shooting at Belandi-Pul village of the Panjway district when the soldier entered homes and opened fire, according to a statement from President Hamid Karzai’s office.

“This intentional killing and terror is an unforgivable act,” Karzai said.

The attack threatens to further worsen relations between the U.S.-led coalition and Afghans, already badly strained by the recent burning of Korans and other religious material by U.S. military personnel. That incident, at the U.S.-run Bagram airbase, north of Kabul, sparked a series of demonstrations and attacks on bases belonging to the U.S. coalition in which at least 30 Afghans were killed.

President Barack Obama and Defense Secretary Leon Panetta called Karzai to offer their condolences and assure him that those responsible will be held accountable.

“I am deeply saddened by the reported killing and wounding of Afghan civilians,” Obama said in a written statement. “I offer my condolences. … 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. I fully support Secretary Panetta’s and General Allen’s commitment t o get the facts as quickly as possible and to hold accountable anyone responsible.”

Initial accounts Sunday said the U.S. soldier left his base at 3 a.m. and walked to nearby homes where he opened fire. There were widely varying claims about the number of dead and wounded.

“Seven are believed to have been killed and eight wounded,” said Javed Faisal, a spokesman for the Kandahar governor earlier today. “The number of dead could rise.”

In a statement, a Taliban spokesman put the number killed at 50.

A spokesman for the International Security Assistance Force, the U.S.-led coalition in Afghanistan, confirmed that the shooting had taken place, but said he could not confirm the number of dead or wounded.

“A United States service member was detained today in connection with an incident that resulted in Afghan casualties in Kandahar province,” said Maj. Jason Waggoner, an ISAF spokesman. “There were multiple civilians wounded, but I don’t have a specific number. All the wounded have been taken to coalition medical facilities and are currently being treated.”

The ISAF commander, U.S. Marine Gen. John R. Allen, said he was shocked and saddened by the attack, which he described in a statement as “deeply appalling.”

“I offer my profound regret and deepest condolences to the victims and their families,” Allen said. “I pledge to the noble people of Afghanistan my commitment to a rapid and thorough investigation.”

The only previous documented case of an unprovoked U.S. military attack on Afghan civilians came in 2010, when an Army Stryker brigade killed 3 people, apparently for sport.

The U.S. Embassy offered its condolences to the victims, and said in a statement that it was “saddened by this violent act against our Afghan friends.”

The embassy said U.S. forces “are providing the highest level of care” for the injured. “We are still attempting to ascertain the facts,” the embassy said.

Jan Agha, who lives near the site of the incident, told McClatchy the U.S. soldier attacked two houses in the village of Gerambai as well as two houses in Belandi-Pul, four kilometers away, including the home of his brother-in-law, Mohammad Naim. He confirmed the government account of dead and injured.

“In Belandi, four civilians were martyred, and five wounded,” said Agha. He said his brother-in-law, Naim, and Naim’s son and daughter were among the wounded in Belandi.

“In the house next to his, Sayed Jan’s house, four people were killed and two were wounded,” he added.

Twelve people were killed in Gerambai, Agha said — 11 in a house belonging to a farmer named Haji Wazir, who was away at the time.

“Their rooms were set on fire after they were killed,” Agha said. “I saw the house that was burnt. This wasn’t the work of just one person.”

However, Capt. Justin Brockhoff, a Kandahar-based ISAF spokesman, said the coalition had no information that more than one person was involved in the attack.