US President Barack Obama has described as "heartbreaking" the shooting of four Marines in Chattanooga, as the FBI identified the gunman as 24-year-old Mohammod Youssuf Abdulazeez.
The Marines were killed in twin shootings at US military centres in the southern state of Tennessee, in what officials said was a possible act of "domestic terrorism".
The gunman was shot dead during Thursday's attack.
US President Barack Obama said authorities did not yet know all the details, but the attack appeared to be carried out by a lone gunman.
"It is a heartbreaking circumstance for these individuals who have served our country with great valour to be killed in this fashion," Obama said, after a briefing from FBI director James Comey.
Obama said the FBI would lead the investigation into the shooting, and that the Department of Defense was making sure "all our defence facilities are properly attended and vigilant".
In a statement the FBI identified the dead gunman as Mohammod Youssuf Abdulazeez.
"While it would be premature to speculate on the motives of the shooter at this time, we will conduct a thorough investigation of this tragedy," it said, adding that three people were injured in the rampage.
Bill Killian, the US federal prosecutor in that part of Tennessee, said the shootings were being investigated as an "act of domestic terrorism", but officials cautioned that no one should jump to conclusions.
"We are looking at every possible avenue - whether it was terrorism, whether it was domestic, international or whether it was a simple criminal act," FBI special agent Ed Reinhold said.
Reinhold said the FBI would use every means possible to "determine the cause or the reason why he carried out this attack".
Local media said Abdulazeez was a naturalised citizen originally from the Middle East, who had been working in the city as a soil engineering specialist.
The Marine Corps confirmed that all four victims were killed at a Navy and Marine Corps Reserve Center.
The other shooting occurred at a recruitment centre several miles away.
Erica Wright said she witnessed the shooting at the recruiting centre through the window of a nearby hair salon.
"We heard one pop, really loud pop. So we went to the door to see what it was," Wright told CNN.
"We saw a guy in a silver Mustang just unloading on the naval recruiting place."
Wright said she watched in horror as the man reloaded his gun and opened fire again. He then backed up his car, pulled up to another part of the recruiting centre and started shooting again.
"We're all shook up," she said. "Never expected something like this."
The incident served as an ugly reminder of other deadly shootings at US military installations, including a 2009 rampage at Fort Hood that left 13 dead and a 2013 attack at the Navy Yard in Washington that left 12 dead.