A gunman unleashed a hail of bullets at two military sites a few miles apart in Tennessee, killing at least four US Marines before he was shot dead by police.
The attacks sent service members scrambling for cover as bullets smashed through the windows.
Federal authorities said they were investigating the possibility of a terrorist act but had no evidence yet that anyone but a lone gunman was involved. They also said there was no indication that the general public was in danger. The FBI has taken charge of the case.
Authorities identified the gunman as Muhammad Youssef Abdulazeez, 24, of Hixson, Tennessee. An official said there was no indication that he was known to federal law enforcement.
The attacks took place minutes apart, with the gunman stopping his car and and spraying dozens of bullets first at a military recruiting centre, then apparently driving to a nearby navy-marine training base seven miles away. The attacks were over within half an hour.
The gunman fired from inside his car when he went to the recruitment centre, but then got out of the vehicle to shoot the four marines at the training centre, FBI agent Ed Reinhold said.
In addition to the Marines killed, three people were reported wounded, including a sailor who was seriously hurt.
“Lives have been lost from some faithful people who have been serving our country, and I think I join all Tennesseans in being both sickened and saddened by this,” state governor Bill Haslam said.
Authorities would not say how the gunman died, but an official said investigators believe Chattanooga police fired the fatal shot that killed him. At least one military commander at the scene also fired at the gunman, but forensic experts determined that police killed him, the official said.
Mr Reinhold said Abdulazeez had “numerous weapons” but would not give details. He said investigators had “no idea” what motivated the shooter, but “we are looking at every possible avenue, whether it was terrorism, whether it’s domestic, international, or whether it was a simple criminal act”.
He also said “there is no indication at this point that anybody else was involved”.
US attorney Bill Killian said “as far as we know at this juncture, there are no safety concerns for the general public”.
Within hours of the shootings, law enforcement officers with guns drawn swarmed what was believed to be Abdulazeez’s house, and two women were led away in handcuffs.
A dozen law enforcement vehicles, including a bomb-squad truck and an open-sided army lorry carrying armed men, rolled into the Colonial Shores neighbourhood of Hixson and police closed off streets and turned away people trying to reach their homes.
Abdulazeez graduated from the University of Tennessee at Chattanooga in 2012 with a bachelor’s in electrical engineering and was a student intern a few years ago at the Tennessee Valley Authority, the government-owned utility that operates power plants and dams across America’s south.
The US National Counterterrorism Centre said it had seen no connection so far to any terrorist organisation. But it noted that the Islamic State (IS) group has been encouraging extremists to carry out attacks in the US and several such home-grown acts of violence or plots have been uncovered in recent months.
In addition to the wounded sailor, a marine was wounded in the leg and a police officer shot in the ankle.
In Washington, President Barack Obama pledged a prompt and thorough investigation into the “heartbreaking” attack and said the White House had been in touch with the Pentagon to make sure military installations are being vigilant.
“It is a heartbreaking circumstance for these individuals who served our country with great valour to be killed in this fashion,” he said.
Vice President Joe Biden said: “Their families have already given a lot to the country, and now this.”
The shootings began at the recruiting centre in Old Lee Highway, where a shot rang out at around 10.30 or 10.45 am, local time, followed a few seconds later by more fire, said Sgt 1st Class Robert Dodge, the building’s leader of army recruiting.
He and his comrades dropped to the ground and barricaded themselves in a safe place. Sgt Dodge estimated there were 30 to 50 shots fired and said doors and glass were damaged at the neighbouring air force, navy and marine offices.
Law enforcement officials told staff that the gunman stopped his car in front of the recruiting station, shot at the building and drove off, said Brian Lepley, a spokesman with the US Army Recruiting Command in Fort Knox, Kentucky.
The recruiting centre sits in a short strip mall, between a mobile phone business and an Italian restaurant, with no apparent special security.
The gunman opened fire next at the Navy Operational Support Centre and Marine Corps Reserve Centre Chattanooga. All the dead were killed there.
The centre is in an industrial area that includes a Coca-Cola bottling plant. The two entrances to the fenced base have unmanned gates and concrete barriers that require approaching cars to slow down to drive around them.
Marilyn Hutcheson, who works at Binswanger Glass across the street, said she heard a barrage of gunfire.
“I couldn’t even begin to tell you how many,” she said. “It was rapid-fire, like pow-pow-pow-pow-pow, so quickly. The next thing I knew, there were police cars coming from every direction.”
She ran inside and she and other employees and a customer waited it out with the doors locked. The gunfire continued with occasional bursts for what she estimated was 20 minutes. Bomb squads, SWAT teams and other authorities rushed to the scene.
“If it was a grievance or terroristic related, we just don’t know,” she said.
Hussnain Javid, a 21-year-old senior at the University of Tennessee, said Abdulazeez studied electrical engineering at the same college and that they both graduated from Red Bank High School in Chattanooga several years apart.
Mr Javid said Abdulazeez was on the high school’s wrestling team and a popular student, “very outgoing” and well known.