Here's what you need to know about Mohammad Youssef Abdulazeez, the gunman who opened fire at two military facilities in Tenn., killing four Marines. (Alice Li/The Washington Post)

A 24-year-old gunman armed with a semiautomatic assault rifle and a handgun moved methodically through a Naval Reserve center last week in Chattanooga, Tenn., as he hunted for Marines and sailors to kill, a senior FBI official said Wednesday.

Edward Reinhold, special agent in charge of the FBI’s field office in Knoxville, Tenn., provided the first definitive account of the terrorist attack that left four Marines and a Navy petty officer dead.

Reinhold told reporters at a news conference in Chattanooga that Mohammad Youssef Abdul­azeez smashed through the gate of the reserve center last Thursday and was almost immediately confronted by a service member who had his own gun.

The service member fired several rounds, but it has not yet been determined whether he managed to hit Abdulazeez, who quickly entered the reserve center looking for targets, mortally wounding the sailor inside the building.

“He then made his way throughout the building continuing to shoot at those who he encountered,” Reinhold said.

What happened in the Tennessee shooting

Reinhold said Abdulazeez exited the back of the building, killing the Marines outside in the motor-pool area as some of them tried to climb over a fence and escape.

The FBI said that moments later, officers with the Chattanooga Police Department arrived and killed Abdulazeez, ending an episode that lasted between three and five minutes at the reserve center.

A top general said the Marines, who had just returned from a training mission, had braved gunfire to save their comrades during the attack.

“The legacy that day is one of valor,” said Maj. Gen. Paul Brier, commander of the 4th Marine Division. “I can tell you that our Marines reacted the way you would expect. Some willingly ran back into the fight.”

Killed Thursday in the assault were Gunnery Sgt. Thomas J. Sullivan, 40, Staff Sgt. David A. Wyatt, 35, Sgt. Carson A. Holmquist, 25, and Lance Cpl. Squire K. “Skip” Wells, 21.

Navy Petty Officer 2nd Class Randall Smith, 26, the fifth service member killed in the attack, died from his wounds early Saturday.

Before entering the Navy Operational Support Center, Abdulazeez, while still in a rented Ford Mustang convertible, fired dozens of rounds into a recruiting office less than 10 miles away.

Five Marines inside the reserve center fled through the rear of the building. One was wounded.

Reinhold said that two other weapons were recovered at the reserve center and that both belonged to service members, including the one fired at Abdulazeez. Another handgun was found near one of the fallen Marines.

“Whether he was struck by those individuals is unclear at this time,” he said. “The autopsy results are pending, and once we get those we’ll make that determination.”

The military is also investigating why the service members were armed, the FBI said. The Pentagon restricts who can carry weapons at domestic military facilities.

It appeared that all of the victims were killed with the same weapon, ruling out “friendly fire,” according to Reinhold.

In addition to the weapons Abdulazeez had on him when he was killed, the FBI discovered a shotgun in his car and another semiautomatic assault rifle in his house.

The FBI is still investigating whether Abdulazeez had any ties to terrorists and what led to the attack. Agents seized personal notes from his house that hinted at extremist views, officials said.

Abdulazeez had also searched the Internet for topics such as martyrdom, possibly as a way to escape his family’s financial difficulties and his depression, the FBI learned after examining his online communications.

“It certainly appears by all accounts that he was self-radicalized,” said a family representative, speaking on the condition of anonymity to discuss the case. “He was in a downward spiral and appears to have hit the bottom of this spiral. He appears to have committed this heinous act in a sort of perverse attempt to redeem himself.”

“We are treating him as a homegrown violent extremist. We believe he acted on his own that day,” Reinhold said. “We don’t have any indication that anyone else was assisting him that day.”

Officials are also looking at a seven-month trip Abdulazeez took last year to Jordan, where he spent time with his grandfather and uncle. His parents sent him there because of concerns over his use of drugs and alcohol.

Jordanian intelligence detained his uncle, Asad Ibrahim Asad Haj Ali, a businessman and naturalized U.S. citizen, who lived in Virginia until 2010.

The family representative said Jordanian intelligence questioned the uncle and then arrested him.

One of the gunman’s friends, James Petty, said he saw Abdul­azeez on July 10 at the local mosque, a week before the deadly rampage.

“That day he was happy,” Petty said.