Investigators are trying to determine why an Iraq war veteran opened fire on fellow service members at the Fort Hood US military base, killing three people and wounding 16 before committing suicide at the same post where more than a dozen people were slain in a 2009 attack.
The shooter was identified as Ivan Lopez by Texas congressman Michael McCaul, chairman of the House of Representatives' Homeland Security Committee. Fort Hood's senior officer, Lieutenant General Mark Milley, said the gunman had sought help for depression, anxiety and other problems.
Among the possibilities investigators planned to explore was whether a fight or argument on the base triggered the attack.
A federal law official said authorities would begin by speaking with the man's wife, and expected to search his home and any computers he owned.
Watch: US army reveals identity of Ft Hood shooter
Lopez apparently walked into a building on Wednesday afternoon and began firing a .45-calibre semi-automatic pistol. He then got into a vehicle and continued firing before entering another building, but he was eventually confronted by military police in a car park.
As he came within 6 metres of an officer, the gunman put his hands up but then reached under his jacket and pulled out his gun. The officer drew her own weapon, and the suspect put his gun to his head and pulled the trigger a final time, Milley said.
The gunman, who served in Iraq for four months in 2011, had been undergoing an assessment before the attack to determine if he had post-traumatic stress disorder, Milley said.
He arrived at Fort Hood in February from another base in Texas. He was taking medication, and there were reports that he had complained after returning from Iraq about suffering a traumatic brain injury, Milley said.
The gunman was never wounded in action, according to military records, and there was no indication the attack was related to terrorism, Milley said. His weapon had been recently purchased in the local area and was not registered to be on the base.
Those injured were taken to the base hospital and other local hospitals. At least three of the nine patients were listed in critical condition.
Wednesday's attack immediately revived memories of the 2009 shooting rampage on Fort Hood, the deadliest attack on a domestic military installation in US history. Thirteen people were killed and more than 30 were wounded.
President Barack Obama vowed a complete investigation. In a hastily arranged statement while in Chicago, Obama reflected on the sacrifices Fort Hood troops have made, including enduring multiple tours to Iraq and Afghanistan.
"They serve with valour. They serve with distinction, and when they're at their home base, they need to feel safe," Obama said. "We don't yet know what happened tonight, but obviously that sense of safety has been broken once again."
Army psychiatrist Nidal Hasan was convicted last year for the November 2009 mass shooting at Fort Hood.