Esteban Santiago, a 26-year-old Iraq war veteran, had a history of acting erratically and investigators are probing whether mental illness played a role in America's latest mass shooting.
Santiago has been charged with carrying out an act of violence at an international airport resulting in death, which carries a maximum punishment of execution. He also faces lesser weapons charges.
The attack took place at the Fort Lauderdale airport's crowded baggage area about 12.30pm on Friday (local time).
Six people were wounded, while about three dozen others were taken to local hospitals with bruises or broken bones suffered in the chaos as passengers fled the area.
Marlin Ritzman, special agent in charge of the Federal Bureau of Investigation's office in Anchorage, told a news conference on Saturday that Santiago walked into the office in November and told agents his mind was being controlled by a US intelligence agency.
He was turned over to local police who took him to a medical facility for a mental evaluation.
"Santiago was having terroristic thoughts and believed he was being influenced by ISIS (the Islamic State militant group,)" Anchorage Police Chief Chris Tolley told media.
A handgun taken from Santiago by police during the evaluation was returned to him early last month, Tolley said, and it was not clear if it was the same weapon used on Friday.
Officials in Anchorage said the gun was returned because Santiago had not been adjudicated to be mentally ill.
"As far as I know, this is not somebody that would have been prohibited (from having a gun) based on the information they had," US Attorney Karen Loeffler told the news conference.
Investigators have not ruled out terrorism as a motive and say the suspect's recent travel is being reviewed.
Authorities say Santiago arrived in Ft. Lauderdale on a connecting flight from Alaska, and that he retrieved a 9mm semi-automatic handgun from his checked luggage before loading it in a bathroom and then shooting indiscriminately.
Witnesses said the gunman, who was wearing a blue "Star Wars" T-shirt, said nothing as he fired, and that he surrendered to police only after running out of ammunition.
Broward County Sheriff Scott Israel told the news conference it took the first deputy about 70 to 80 seconds to contact the suspect after the first shots rang out.
Florida Governor Rick Scott said people just trying to live their lives and enjoy the weekend had been senselessly murdered, and that some of the victims were still in surgery fighting for their lives.
Authorities said three of the six victims who suffered gunshot wounds are in intensive care. The others are in good condition. Those killed included a volunteer firefighter in his sixties and a retiree on holiday with her husband.
DECORATED VETERAN
Santiago served from 2007 to 2016 in the Puerto Rico National Guard and Alaska National Guard including a deployment to Iraq from 2010 to 2011, according to the Pentagon.
A private first class and combat engineer, he received half a dozen medals before being transferred to the inactive ready reserve in August last year.
An aunt said he came back from his deployment "a different person," MSNBC reported.
The attack was the latest in a series of US mass shootings, some inspired by Islamist militants, others carried out by loners or the mentally disturbed.
In June last year, Florida was the scene of the deadliest shooting rampage in modern American history, when a gunman apparently inspired by Islamic State killed 49 people and wounded 53 at the gay nightclub "Pulse" in Orlando.