An Army veteran who complained that the government was controlling his mind drew a gun from his checked luggage on arrival at the Fort Lauderdale airport and opened fire in the baggage claim area Friday, killing five people and wounding six, authorities said.
He was taken into custody after throwing his empty weapon down and lying spread-eagle on the ground, one witness said.
The gunman was identified by authorities as 26-year-old Esteban Santiago, who served in Iraq with the National Guard but was demoted and discharged last year for unsatisfactory performance. His brother said he had been receiving psychological treatment recently.
A law enforcement official told The Associated Press that Santiago had walked into the FBI office in his hometown of Anchorage, Alaska, in November to say that the U.S. government was controlling his mind and making him watch Islamic State videos.
Agents questioned him and called police, who took him for a mental health evaluation, according to the official, who was not authorized to discuss the investigation and spoke on condition of anonymity.
Authorities said the motive for the attack was under investigation. Shortly after the shooting, and before details of Santiago's mental health became public, Sen. Bill Nelson of Florida said that it remained to be seen whether it was terrorism or the work of "someone who is mentally deranged."
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 cars or 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."
RELATED: President-elect Donald Trump on deadly shooting at Fort Lauderdale airport: 'Thoughts and prayers'
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.
Santiago arrived in Fort Lauderdale after taking off from Anchorage aboard a Delta flight Thursday night, checking only one piece of luggage -- his gun, said Jesse Davis, police chief at the Anchorage airport.
At Fort Lauderdale, "after he claimed his bag, he went into the bathroom and loaded the gun and started shooting. We don't know why," said Chip LaMarca, a Broward County commissioner who was briefed by investigators.
The bloodshed is likely to raise questions of whether aviation safety officials need to change the rules.
The attack also exposed another weak point in airport security: While travelers have to take off their shoes, put their carry-on luggage through X-ray machines and pass through metal detectors to reach the gates, many other sections of airports, such as ticket counters and baggage claim areas, are more lightly secured and more vulnerable to attack.
In 2013, a gunman with a grudge against the Transportation Security Administration shot and killed one of the agency's screeners and wounded three others during a rampage at Los Angeles International Airport.
Last November, an airline worker was shot and killed near an employee parking lot at Oklahoma City's airport, and in 2015 a machete-wielding man was shot to death after he attacked federal security officers at the New Orleans airport.
"While we have authorized doubling the number of TSA canine teams to try to prevent tragedies like this, the fact is that wherever there are crowds, such as at our airports, we remain vulnerable to these types of attacks," Nelson said.
The Fort Lauderdale 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," according to Lea. The killer 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.
The gunman was arrested unharmed, with no shots fired by law enforcement officers, and was being questioned by the FBI, Sheriff Scott Israel said.
The condition of the wounded was not disclosed.
President Barack Obama was briefed by his Homeland Security adviser, the White House said. President-elect Donald Trump said that it is a "disgraceful situation that's happening in our country and throughout the world" and that it was too soon to say whether it was a terrorist attack.
Santiago's brother, Bryan, told the AP 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 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.
At the Fort Lauderdale airport, inbound flights were diverted and those waiting to take off were held on the ground, as police and paramedics rushed in. At least one person appeared to be lying in a pool of blood with a head wound.
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."