The Army staff sergeant who allegedly went on a rampage and killed 16 Afghans as they slept in their homes had a traumatic brain injury at one point and had problems at home after his last deployment, officials told ABC News.

But the soldier, who is based at Fort Lewis in Washington, was considered fit for combat duty and deployed to Afghanistan in December, officials said.

Details about the staff sergeant, who has not been identified, emerged as the Taliban vowed revenge against "sick-minded American savages" after the mass killing.

What has trickled out about the suspect is that he was 38 and serving on his fourth combat deployment in 10 years, the first three in Iraq. He was on his first tour in Afghanistan, where he'd been since December.

When the massacre took place he was assigned to Camp Belambay, a remote combat outpost where his job was to be protection for Special Operations Forces who were creating local militias. He was not a member of the special forces unit.

An official told ABC News that the soldier has suffered a mild traumatic brain injury (TBI) in the past, either from hitting his head on the hatch of a vehicle or in a car accident. He went through the advanced TBI treatment at Fort Lewis and was deemed to be fine.

He also underwent mental health screening necessary to become a sniper and passed in 2008. He had routine behavioral health screening after that and was cleared, the official said.

When the soldier returned from his last deployment in Iraq he had difficulty reintegrating, including marital problems, the source told ABC News. But officials concluded that he had worked through those issues before deploying to Afghanistan.

The shooting occurred at 3 a.m. in three houses in two villages in the Panjway district of southern Kandahar province, an area that was once a Taliban safe haven but has recently become more safe after a surge of troops in 2009.

The soldier left the base in the middle of the night and wore night-vision goggles during the alleged rampage, according to a source.

The first village was more than a mile south of the base. While there, he allegedly killed four people in the first house. In the second house, he allegedly killed 11 family members -- four girls, four boys and three adults.

He then walked back to another village past his base where he allegedly killed one more person, according to a member of the Afghan investigation team and ABC News' interviews with villagers.

All of the victims were shot in their homes, according to villagers and the Afghan president's office.

Video from the scene show blood-splattered floors and walls inside a villagers home and blood-soaked bodies of victims, including the elderly and young children, wrapped in blankets and placed in the backseat of a van. Some of the bodies appear to have been burned.

John Kirby, a Pentagon spokesman, said officials "don't know what his [soldier's] motivation was. We are looking into that."

After the alleged shooting spree, it's believed the soldier returned to the base on his own and calmly turned himself in. He remains in NATO custody. One source told ABC News that the soldier had "lawyered up" and declined to talk.

Because of the soldier's role as supporting security for the special operations forces, he is not believed to have known the victims. But it's not clear whether the alleged attack was spontaneous and unprovoked.

Shooting in Afghanistan

The Taliban vowed revenge against "sick-minded American savages" after the mass killing.

The group said it would "take revenge from the invaders and the savage murderers for every single martyr," according to a statement posted on its website, the Times of London reported.

The fear now is that this latest incident could set off a fresh wave of violence.

The attack comes just as outrage stemming from burning of several Korans by members of the U.S. military seemed to be calming down.

The U.S. Embassy in Kabul has warned foreigners to keep a low profile.

Afghan President Hamid Karzai called it "an assassination, one that cannot be forgiven."

The Afghan parliament has passed a resolution in protest of the killings, and asked for a public trial of the U.S. soldier.

U.S. officials were quick to condemn the attack Sunday.

"I offer my profound regret and deepest condolences to the victims and their families," Gen. John Allen, head of NATO forces in Afghanistan, said in a statement.

"This deeply appalling incident in no way represents the values of ISAF [International Security Assistance Force] and coalition troops or the abiding respect we feel for the Afghan people."

NATO has launched its own investigation, and Karzai has sent his delegation to Kandahar for its own inquiry.

The White House said Sunday that Obama called "President Karzai to express his shock and sadness at the reported killing and wounding of Afghan civilians. President Obama extended his condolences to the people of Afghanistan, and made clear his Administration's commitment to establish the facts as quickly as possible and to hold fully accountable anyone responsible. The president reaffirmed our deep respect for the Afghan people and the bonds between our two countries."