FORT LAUDERDALE, Fla. — A shooting at the Fort Lauderdale airport Friday left five dead and eight wounded as the airport descended into chaos, with passengers taking shelter and flights diverted.

A suspect identified by authorities as Esteban Santiago, 26, was taken into custody without incident. He had reportedly retrieved a gun from a checked bag and started shooting in the baggage claim area. A veteran who served in Iraq, he had been discharged from the Alaska Army National Guard last year for unsatisfactory performance, according to its public affairs office.

The suspect's brother said Santiago had been receiving psychological treatment recently.

“We don't know a motive at this point,” said Sen. Bill Nelson, D-Fla. “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.”

According to a CBS News report that quoted federal law enforcement sources, Santiago had gotten into an argument with a passenger on one leg of his trip from Alaska, which ended with a Delta flight to Fort Lauderdale.

Broward County Commissioner Chip LaMarca said the suspect arrived with a checked gun, claimed his bag, took the gun from bag, went into the bathroom to load it and then came out and started shooting.

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.

The bloodshed is likely to raise questions whether aviation safety officials need to change the rules.

One witness said the attacker gunned down his victims without a word and kept shooting until he ran out of ammunition for his handgun, sending panicked travelers running out of the terminal and spilling onto the tarmac, baggage in hand.

Others crouched behind anything else they could find to shield themselves as police and paramedics rushed in to help the wounded and establish whether there were any other gunmen. The airport was shut down.

“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.”

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 shooter went through about three magazines before running out 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.

Santiago arrived in Fort Lauderdale after taking off from his hometown of Anchorage on Thursday night, checking only one piece of luggage — his gun, said Jesse Davis, police chief at the Anchorage airport.

The wounded were taken to Broward Health Medical Center in Fort Lauderdale. Dr. Ralph Guarneri, the trauma surgeon on call, said all the wounded victims remained alive and in stable condition.

Broward County Sheriff Scott Israel said the gunman was arrested unharmed, with no shots fired by law enforcement officers, and was being questioned by the FBI.

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 as police and paramedics rushed in.

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

Gov. Rick Scott said during a news conference that he had called President-elect Donald Trump and Vice President-elect Mike Pence and they told him that they would do everything they could to provide whatever resources Florida needs.

He said he did not call Obama, adding that he has a personal relationship with Trump and Pence.

Santiago's brother, Bryan, said 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 and 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. He later joined the Alaska National Guard.

The Pentagon said Santiago had gone AWOL several times during his stint with the Alaska National Guard and was demoted — from specialist to private first class — and given a general discharge, which is lower than an honorable discharge.

The Associated Press contributed to this article.