Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A gunman unleashed a barrage of gunfire at two military centers in Chattanooga Thursday, killing four Marines, injuring a police officer and a Marine recruiter, and critically injuring a Navy sailor, authorities said.

The gunman was killed after a shootout with police at the second facility, authorities said. An autopsy is pending, and it is not clear whether police killed him or he killed himself.

The gunman was identified as Mohammad Youssuf Abdulazeez, 24. He was a naturalized U.S. citizen from Kuwait, a federal official said.

"It is incomprehensible to see what happened and the way individuals who proudly serve our country were treated,” Chattanooga Mayor Andy Berke said.

Authorities offered no immediate information on a motive. Bill Killian, the top federal prosecutor for eastern Tennessee, said the attack was being investigated as an act of domestic terrorism.

The shootings began at around 10:45 a.m. and occurred over about 30 minutes and six miles apart, first at a military recruitment station and then at a Navy and Marines reserve center. A defense official said the gunman used an automatic weapon. Officials said he was armed with numerous weapons.

The Marines were killed at the reserve center. The Marine Corps said their names would be released after their relatives were notified. A Navy sailor was shot multiple times and was "critically injured," a defense official said. The sailor is being treated at a hospital.

President Barack Obama said all the details are not yet known but pledged a thorough and prompt investigation.

"My main message right now is obviously the deepest sympathies of the American people to the four marines that have been killed," he said. "I'd ask all Americans to pray for the families," Obama said.

The gunman first opened fire from his car on the recruiting station, firing 25 to 30 rounds and riddling the doors with bullet holes and striking a Marine recruiter in the leg, authorities said. The four military personnel inside took cover and barricaded themselves in a back room.

"There was the one single shot that alerted us, and about a second or so after that the first volley of fire erupted,” Army Sgt. Robert Dodge told NBC News. That volley was followed by a second burst of gunfire, he said.

April Grimmett, 19, was at school near the recruitment center when someone inside said they saw someone ducking between cars, and then the sound of gunfire rang out. It sounded like a jackhammer, she said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"As soon as I turned he was ducking down, he was on the phone, and we heard all those shots fire," she said. "It was loud and it was fast."

The gunman then drove off to the reserve center where the Marines were killed and the Navy sailor was shot multiple times, authorities said.

Once inside the gate of the reserve center, the gunman "exited his vehicle and engaged in gunfire," FBI Special Agent Edward W. Reinhold told reporters Thursday.

"We have no idea at this point what his motivation was behind the shootings," Reinhold said. "At this point, we don’t have anything that directly ties him to an international terrorist organization," he said.

Berke, the mayor, said police rushed from all over the city to confront the shooter. "They were engaging him as he went to the second facility, to stop him. Despite all that he kept going," Berke said.

"This was certainly a horrific, awful, very directed attack," he said.

Police said the rampage could have been worse. "I can tell you that the officers of the Chattanooga police department saved many lives today," Chattanooga Police Chief Fred Fletcher told reporters late Thursday.

Mohammad Youssduf Adbulazeer WRCB

Chattanooga police Officer Dennis Pedigo was shot in the ankle and taken to a hospital. The Marine recruiter was shot in the leg and was treated and released.

"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," Gov. Bill Haslam said.

The University of Tennessee at Chattanooga said Abdulazeez was a 2012 graduate with a degree in electrical engineering but was not currently enrolled. The Tennessee Valley Authority said he was a student intern at the agency five years ago.

Authorities said they have no reason to believe anyone else was involved in the shooting, and no one else was arrested in the attack Thursday. Law enforcement officers searched a home thought to be connected to Abdulazeez hours after the attack, authorities said.

Several officials said there was no intelligence indicating the attack ahead of time. Abdulazeez was not in any terrorism database, had not been under FBI surveillance and was not known to federal law enforcement, the officials said.

Homeland Security Secretary Jeh Johnson said security is being increased at certain federal facilities "out of an abundance of caution."

U.S. Attorney General Loretta Lynch called the attack a "shameful and cowardly act of violence" and said the FBI will take the lead in the investigation.

The Armed Forces Career Center through a bullet-riddled door after a gunman opened fire on the building Thursday, July 16, 2015, in Chattanooga, Tenn. NBC News

Dozens of people lined up at a nearby blood donation center after the shootings."This is my city. My friends and my family live here. We still don't know who is involved but I knew I could help this way," said Deejay Haas, one of those who gave blood after the rampage. By the time she left the center, there was a two to three hour wait to give blood.

The health department, colleges and other facilities in Chattanooga were locked down during the rampage, as was the governor's office in Nashville.

U.S. House Speaker John Boehner offered his condolences to the families of the victims. "Today's cowardly attack is a reminder that our men and women in uniform are under constant threat, no matter where they serve," he said.

Both of Tennessee's U.S. senators addressed the shooting on the Senate floor and offered their condolences.

Deeply saddened & disturbed by the shooting in #Chattanooga. My thoughts & prayers are with the families & Marines taken from us today. — Dr. Rand Paul (@RandPaul) July 16, 2015

Secretary of the Navy Ray Mabus called the shooting rampage "devastating and senseless."

"While we expect our Sailors and Marines to go into harm's way, and they do so without hesitation, an attack at home, in our community, is insidious and unfathomable," Mabus said. "As the investigation unfolds, our priority will be to take care of the families of those affected."

Carolyn Taylor, who works in an area of Chattanooga that was locked down, told NBC affiliate WRCB that she heard several gunshots before police began rushing to Amnicola Highway near the incident at the reserve center.

"I've worked on Amnicola for several years," Taylor said. "I've never seen anything like this. Never."