Esteban Santiago was mentally ill enough to walk into an FBI office in November with his infant son and inform federal agents his brain was being controlled by a government intelligence agency that wanted him to join the Islamic State.

But under the law those delusions and the brief hospitalization that followed were not enough to keep his gun away from him.

Since Santiago allegedly shot to death five people at a baggage claim in the international airport in Fort Lauderdale, Florida, on Friday, attention has focused on what happened in Alaska two months before the rampage: On the same day that the 26-year-old showed up at Anchorage FBI headquarters making "incoherent, disjointed statements," an Anchorage police officer took his handgun away — only to have police give it back a month later.

How did a man who had presented himself to federal officials ranting about mind control get a firearm back? Did police have the legal ability to do anything else?

Police may have had no choice under current laws but to return his gun.

It takes a lot to lose your gun due to mental illness in Alaska.

"If there had been a civil commitment order or serious criminal convictions, it would have been illegal for him to have a gun," said Mark Regan, an attorney for the Disability Law Center of Alaska.

Santiago was only hospitalized for four days and there is no record of him being involuntarily committed, a lengthier process. And though he had a series of run-ins with police for domestic violence-related allegations, he did not have any felony criminal convictions in Alaska.

Alaska has no state laws regulating gun ownership by mentally ill people — in fact, it has no state laws at all defining who can own a gun beyond federal standards.

The federal standard says that a person who has been "adjudicated mentally defective" by a judge or who has been "committed to a mental institution" cannot legally possess a firearm. While details of any mental health treatment for Santiago are confidential, along with any court proceedings involving civil commitment, it's not clear that Santiago met either of those criteria.

After the Nov. 7 encounter at the FBI building, Santiago was taken by a police officer to a psychiatric facility. He may have gone voluntarily or under a provision of law that allows for the "emergency detention" of a person in crisis when "considerations of safety do not allow" the initiation of more involved involuntary commitment procedures. The document that police officers must fill out asks whether the person is a danger to self or others, or whether the person is "gravely disabled" by mental illness.

If the answer is yes, the person can be held for about 72 hours, or three days. Police have said Santiago was held for four.

If the person still doesn't meet the standard to be released, filings for an involuntary commitment to keep the person in the hospital begin. Statewide there were 2,827 civil commitment proceedings during the 2016 fiscal year, according to Alaska State Court System statistics. Of the total, 1,706 were in Anchorage courts — more than four each day. The statistics don't show how often a person was actually found ill enough to be forced to stay in the hospital.

Around the country and in Alaska, that standard is hard to meet.

"Commitment is harder and harder to get. There are no beds," said Joshua Horwitz, the executive director of the Educational Fund to Stop Gun Violence in Washington, D.C.

Dorrance Collins and Faith Myers agree. Both have spent time at the Alaska Psychiatric Institute in the past and are now advocates for the rights of psychiatric patients.

"Today you can't just be walking around mumbling of having delusions," said Collins. "The standard is really high."

Myers spoke of a time in the early 2000s during an episode of mental illness where she was found asleep in a snowdrift, believing it was a bed, and still didn't meet the standard to be committed.

Santiago was released after four days of evaluation, much shorter than the initial 30-day commitment period. His brother told The New York Times that he didn't know of any other hospitalizations after that.

But without being "adjudicated mentally defective" or involuntarily committed — the standard for losing the right to gun ownership, by the only law that speaks to the issue in Alaska — police would not have had a legal right to hold on to Santiago's gun.

So they gave it back.

On Nov. 17, APD said it sent Santiago a letter about getting his gun back.

On Nov. 30, Santiago showed up at APD headquarters to retrieve his gun. FBI agents were there too. For a reason APD has not explained, he didn't take the gun that day.

It was released to him one week later, on Dec. 7.

On Monday, APD refused to answer questions about their policies on seizing guns from people in mental health crises, or when and why guns are returned to their owners.

Representatives of the Alaska Department of Law and the Anchorage District Attorney's Office did not respond to questions about the legal basis for such firearm confiscations in Alaska.

An increasing number of states are using new legal tools to get guns out of the hands of people who demonstrate a propensity to use them for violence, said Horwitz of the Educational Fund to Stop Gun Violence.

States like California, Connecticut and Washington have adopted gun violence restraining orders, which allow family members to seek an order to temporarily remove a person's gun based on violent behavior or threats. Other states have added an involuntary hospitalization — such as a 72-hour hold — to the list of reasons a person can be temporarily disqualified from possessing a gun, usually for five years. Under that standard, Santiago might have lost his gun for years.

But in a state where guns are a part of the fabric of everyday life as a tool for hunting and self-protection and where it isn't unusual to see a handgun on a fellow grocery store shopper's waistband, would there be any will to restrict people's access to their guns?

Horwitz thinks so.

"Alaska for such a sparsely populated state has a huge suicide and a high homicide rate. And it is a shame. What I think is important about the approach is it is a temporary approach, and it gets people when they are in the heat of a crisis."

Much is still not known about Santiago's passage through Alaska's mental health and legal system to the airport in South Florida. But as the case is examined, Alaska may be having a new conversation about guns and people in crisis.