Santiago showed signs of violence and what authorities called “erratic behavior” in the months before they said he traveled 4,000 miles from home, loaded a gun in a baggage area and killed five people in some 80 seconds.

“The area was crowded with newly-arrived passengers retrieving their luggage,” according to a news release from the Department of Justice. “Santiago started shooting, aiming at his victims’ heads until he was out of ammunition.”

Santiago is scheduled to make his first court appearance on Monday at 11 a.m. before a magistrate judge in Fort Lauderdale.

Investigators said Saturday that Santiago drew frequent police attention for domestic violence in his Alaska home town and twice was arrested within the past year. Two months before the shooting, they said, he was admitted to a mental-health facility after showing up at an FBI field office and telling agents that his mind was being controlled, complaining that the government was forcing him to watch Islamic State videos.

Police held his gun for a month and then gave it back to him, authorities said.

Those sporadic run-ins now raise questions about how Santiago evaded detection as he boarded two flights – checking in a weapon – before he landed at Fort Lauderdale-Hollywood International Airport and allegedly fired at unsuspecting travelers.

Investigators said they were still trying to determine if there was a terrorism motive. A day after the shooting, agents had interviewed more than 100 people, including Santiago, who surrendered after firing all of his ammunition by dropping onto the floor, spread-eagle, near a baggage area when a sheriff’s deputy approached him, according to an FBI affidavit.

Investigators are scouring Santiago’s electronics and digital media and are trying to determine whether he had any real contact with Islamic State sympathizers, and whether that motivated him to carry out the shooting, said a law enforcement official familiar with the case who spoke on the condition of anonymity.

“We have not ruled out anything,” George Piro, the FBI special agent in charge of the bureau’s Miami division, said Saturday morning at a briefing. “We continue to look at all avenues, all motives for this attack. And we continue to look at the terrorism aspect as a motive.”

The bloody rampage sent people scrambling through the terminals and across the airfield at one of the country’s busiest airports, shutting down all flights for hours as paramedics flooded the scene along with federal and local law enforcement officers. Six people were injured in the shooting, and dozens more were hurt in the chaos that followed.

Santiago was placed in federal custody Saturday morning, following a lengthy interview by Broward County Sheriff’s deputies and FBI agents. The federal charges against him are: performing an act of violence against a person at an airport serving international civil aviation that caused serious bodily injury; using and carrying a firearm during and in relation to a crime of violence; and causing the death of a person through the use of a firearm.

The FBI is leading a sprawling investigation that spans from Florida to Alaska. Names of the victims have not yet been released, because not all families have been notified. The Associated Press reported that at least four of the five were vacationers picking up their bags before going to board cruise ships.

Santiago is believed to have lived most recently in Anchorage, with a girlfriend and a young child. Neighbors said two other children also lived at the house. Local police and FBI officials in a Saturday news conference described his life as chaotic, with frequent police run-ins.

At least four times in 2016, police were called to Santiago’s house for physical disturbances or domestic violence. It is unclear who made those calls. In one case, he appears to have taken a plea deal and, in exchange for compliance with its terms, the charges were dismissed.

When he showed up in November at the local FBI office, he had a newborn and a weapon in the car, Anchorage Police Chief Chris Tolley said. But in an interview at the time with the FBI, Santiago stated that “he did not wish to harm anyone,” said Marlin Ritzman, special agent in charge of the FBI’s Anchorage field office.

“Our agents contacted local authorities who took custody of Mr. Santiago and transported him to a local mental-health facility for evaluation,” Ritzman said. He said that the FBI interviewed his family members, conducted database reviews and interagency checks, and ultimately closed what it termed an “assessment” of Santiago.

Santiago’s weapon was logged “for safekeeping,” Tolley said. But one month later, the weapon was released to him.

Santiago arrived in Fort Lauderdale on Friday after flying from Anchorage, with a layover in Minneapolis. He traveled alone and checked a single bag – one that contained his firearm, said Jesse Davis, chief of police at Ted Stevens Anchorage International Airport, where passengers routinely check weapons. “We’re a big hunting state, so we get quite a lot of that,” Davis said.

Travelers are allowed to bring firearms with them onto flights as long as the guns are unloaded, locked in a hard-sided container and in checked baggage, according to the Transportation Security Administration. Ammunition can be brought onto flights but also must be placed in checked baggage.

“Everything appeared normal,” Davis said. Santiago checked in for his Delta flight more than four hours early, which was unusual, Davis said, but “didn’t call attention to himself at all.”

In Fort Lauderdale, at the Terminal 2 baggage claim, Santiago picked up his bag from the carousel, went to the bathroom and loaded his Walther 9mm semiautomatic handgun, federal officials said. When he came out, he began firing, shooting the first people he encountered, according to an FBI affidavit.

Mario Andrade, a driver from Carey Limousine, was waiting for his customer, Ari Fleischer, who was White House press secretary under President George W. Bush, near the bottom of the escalator in the Delta baggage area of Terminal 2. He was holding a sign with Fleischer’s last name and talking on the phone with another driver. Fleischer’s 12:15 p.m. flight was late, and it was nearly 1 p.m.

He said that he immediately dropped to the floor, people were running and he heard screaming all around him.

Andrade said he looked up and saw a man in a blue shirt who had a gun in his hand. The gunman, he said, began walking slowly toward him and had a “surprised look” on his face, “like, ‘Oh my God, what happened?’ ”

Relatives told news outlets that Santiago had a history of mental-health problems, including some that followed his military service in Iraq with the Puerto Rico National Guard.

“Only thing I could tell you was when he came out of Iraq, he wasn’t feeling too good,” his uncle, Hernan Rivera, told Newark’s Star-Ledger newspaper.

His aunt told the newspaper that Santiago was hospitalized after returning from Iraq.

“He lost his mind,” Ruiz Rivera said in Spanish.

He had seemed to get the help he needed, and became a father in September, she told Noticias Telemundo. But his mental-health issues, she said, worsened in December. “They took him to the hospital, but they didn’t tell me what for, but they had him in an isolated room because he was a little wrong in the head and he started to like hear things,” she said.

Santiago should have been hospitalized for longer than four days given the gravity of his claims, his brother, Bryan Santiago, said, according to NBC News.

“Four days for a guy who talked to the FBI (about) those things … that is a serious argument, you know? He goes to the FBI saying that he (was) hearing voices, that the CIA are saying that he needs to join ISIS.”