Afghan President Hamid Karzai, who called the shooting spree "unforgivable" and "an act of terror," said those killed included nine children and three women, and another five people were wounded.
The soldier eventually broke into three separate houses, The New York Times reported. At the first house villagers told the newspaper, the suspect gathered 11 bodies, including four girls younger than 6, and set them on fire.
U.S. officials who requested anonymity told the Los Angeles Times the soldier apparently suffered a mental breakdown. ABC News reported investigators will look into the possibility the soldier may be mentally unstable as a result of post-traumatic stress disorder.
The White House issued a statement by President Barack Obama, who said he was "deeply" saddened.
"I am deeply saddened by the reported killing and wounding of Afghan civilians," Obama said. "I offer my condolences to the families and loved ones of those who lost their lives, and to the people of Afghanistan, who have endured too much violence and suffering. 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."
Obama said he fully supports the Pentagon's efforts "to get the facts as quickly as possible and to hold accountable anyone responsible."
In Afghanistan, the wounded were being treated in NATO International Security Assistance Force facilities, an ISAF spokesman said.
ISAF commander Gen. John Allen said, "I am absolutely dedicated to making sure that anyone who is found to have committed wrongdoing is held fully accountable," CNN reported.
Meanwhile, the suspect was reported in military custody.
A U.S. military official told CNN the suspect is from Joint Base Lewis-McChord in Washington state and is assigned to a Special Forces unit. A U.S. official told ABC News the suspect is a 38-year-old staff sergeant, who is married with two children, and began serving his first tour in Afghanistan in December after having served three tours in Iraq.
Reports from the Afghan government and NATO said the soldier left a military base at 3 a.m. and began firing at houses in the village of Belandi in the southern province of Kandahar.
U.S. military spokesman Maj. Jason Waggnor said it wasn't immediately apparent what set off the rampage, The Washington Post reported.
"He walked right off base, started shooting civilians, and returned to the base and turned himself in," Waggnor said.
The U.S. military issued a brief statement following the shootings.
"This is a deeply regrettable incident and we extend our thoughts and concerns to the families involved," the release said.
Afghanistan already had been in an uproar because of the accidental burning of Korans by the U.S. military last month. Violence provoked by that incident left six U.S. soldiers dead.