By David Fischer

Associated Press

FORT LAUDERDALE, Fla. — An arriving airline passenger with a gun in his luggage opened fire in the baggage claim area at the Fort Lauderdale airport Friday, killing five people and wounding eight before throwing his weapon down and lying spread-eagle on the ground, authorities and witnesses said.

The gunman — identified by authorities as 26-year-old Esteban Santiago, of Anchorage, Alaska, an Army National Guard veteran who served in Iraq — was immediately taken into custody. His brother said he had been receiving psychological treatment recently.

People stand on the tarmac at the Fort Lauderdale-Hollywood International Airport after a shooter opened fire inside a terminal of the airport, killing several people and wounding others before being taken into custody, Friday, Jan. 6, 2017, in Fort Lauderdale, Fla. (AP Photo/Lynne Sladky)

The attack sent panicked passengers running out of the terminal and onto the tarmac, baggage in hand, and forced the shutdown of the entire airport.

"People started kind of screaming and trying to get out of any door they could or hide under the chairs," a witness, Mark Lea, told MSNBC. "He just kind of continued coming in, just randomly shooting at people, no rhyme or reason to it."

Authorities said the motive was under investigation.

"This could well be someone who is mentally deranged, or in fact it could be someone who had a much more sinister motive that we have to worry about every day, and that is terrorism," said Sen. Bill Nelson of Florida. "We can't conclude that."

President Barack Obama was briefed by his Homeland Security adviser, the White House said.

It is legal for airline passengers to travel with guns and ammunition as long as the firearms are put in a checked bag — not a carry-on — and are unloaded and locked in a hard-sided container. Guns must be declared to the airline at check-in.

Chip LaMarca, a Broward County commissioner who was briefed on the attack by the sheriff's office, told The Associated Press that the shooter had arrived aboard a Canadian flight with a gun in a checked bag.

"After he claimed his bag, he went into the bathroom and loaded the gun and started shooting. We don't know why," LaMarca said.

However, the Canadian Embassy said the suspect did not arrive from Canada and was not on an Air Canada flight, but instead appeared to have flown from Anchorage, Alaska. The attack took place at Terminal 2, which serves Delta Air Lines and Air Canada.

Lea said the gunman said nothing as he "went up and down the carousels of the baggage claim, shooting through luggage to get at people that were hiding." The killer had a handgun and went through about three magazines of ammunition, Lea said.

"He threw the gun down and laid spread-eagle on the ground until the officer came up to him," Lea said.

Sheriff Scott Israel said five people were killed and eight were wounded. Their condition was not disclosed. He said the gunman was arrested unharmed, with no law enforcement officers firing any shots, and was being questioned by the FBI.

People spilled onto the tarmac, some carrying luggage, and some ran from both Terminals 1 and 2, hiding behind cars or anything else they could find to shield themselves.

The airport suspended operations as law enforcement authorities rushed to the scene and emergency medical workers treated the bleeding victims. Fort Lauderdale-bound flights already in the air were delayed or diverted, and those that had yet to take off from the airport were held on the ground.

At least one person appeared to be lying in a pool of blood with a head wound.

Santiago's brother, Bryan, told The Associated Press that his brother had been receiving psychological treatment in Alaska. He said Santiago's girlfriend alerted the family to the situation in recent months.

Bryan Santiago said that he didn't know what his brother was being treated for and that they never talked about it over the telephone.

He said Esteban Santiago was born in New Jersey but moved to Puerto Rico when he was 2. He was deployed to Iraq in 2010 and spent a year there with the 130th Engineer Battalion, according to Puerto Rico National Guard spokesman Maj. Paul Dahlen.

At the Fort Lauderdale airport, John Schilcher told Fox News said he came up to the baggage claim and heard the first gunshot as he picked up his bag off a carousel.

"The person next to me fell to the ground and then I started hearing other pops. And as this happened, other people started falling and you could hear it and smell it, and people on either side of me were going down and I just dropped to the ground," said Schilcher, who was there with his wife and mother-in-law. "The firing just went on and on."

"I was down on the floor. When we finally looked up there was a policeman standing over me," he said. "That's when I assumed it was safe."

Shocking scene as passengers from #FLL being led away from property with their hands up https://t.co/Ox6sbbs50M pic.twitter.com/ncvLjEzfNJ — WPLG Local 10 News (@WPLGLocal10) January 6, 2017

Police swarm second story of Terminal 2 parking garage at #FLL telling us to duck for cover after reports of second incident. @wsvn pic.twitter.com/00eqjFO5g1 — Joe Roetz 7News (@JoeRoetz) January 6, 2017

Sheriff Israel: At this point, looks like FLL shooting suspect Esteban Santiago "acted alone." https://t.co/HghZJ1391H — WSVN 7 News (@wsvn) January 6, 2017