(CNN) He was incoherent and agitated. Voices in his head told him to join ISIS, according to law enforcement sources.

Authorities were so concerned when Esteban Santiago visited the FBI Anchorage, Alaska, office in November that they confiscated his gun and ordered a mental health evaluation. A month later, Santiago retrieved the weapon from police headquarters.

Last week, Santiago, 26, used that same gun, law enforcement sources said, to kill five people and wound several others at Fort Lauderdale-Hollywood International Airport. Santiago confessed to planning the assault, according to court papers.

As authorities work to pinpoint Santiago's motive, others are asking another question: Why did the suspected gunman still have his firearm?

A ground stop was issued for the Fort Lauderdale airport after the shooting. Most flights scheduled to land will be delayed or diverted, and no flights will depart for the time being, the FAA said.

A ground stop was issued for the Fort Lauderdale airport after the shooting. Most flights scheduled to land will be delayed or diverted, and no flights will depart for the time being, the FAA said.

Police officers stand on the perimeter road at the Fort Lauderdale-Hollywood International Airport.

Police officers stand on the perimeter road at the Fort Lauderdale-Hollywood International Airport.

A shooting victim is taken into Broward Health trauma center in Fort Lauderdale. Eight people were being treated there after they were injured at the airport, officials said.

A shooting victim is taken into Broward Health trauma center in Fort Lauderdale. Eight people were being treated there after they were injured at the airport, officials said.

Officials said it's too early in the investigation to know for certain what prompted a man to open fire on people at the baggage claim area in Terminal 2.

Officials said it's too early in the investigation to know for certain what prompted a man to open fire on people at the baggage claim area in Terminal 2.

People react after the shooting at the Fort Lauderdale airport. The first call about the incident came in at 12:55 p.m. ET, authorities said.

People react after the shooting at the Fort Lauderdale airport. The first call about the incident came in at 12:55 p.m. ET, authorities said.

Law enforcement personnel arrive in an armored car outside the airport.

Law enforcement personnel arrive in an armored car outside the airport.

People take cover outside the airport in the chaos following the shooting.

People take cover outside the airport in the chaos following the shooting.

People stand on the tarmac at Fort Lauderdale-Hollywood International Airport after a gunman opened fire inside Terminal 2 on Friday, January 6.

People stand on the tarmac at Fort Lauderdale-Hollywood International Airport after a gunman opened fire inside Terminal 2 on Friday, January 6.

People run out on the tarmac in the aftermath of the shooting Friday, January 6, at the airport in Fort Lauderdale, Florida. Five people were killed and eight others were wounded , officials said.

Federal law

The federal Gun Control Ac t bars a person "who has been adjudicated as a mental defective or has been committed to any mental institution," from owning a firearm.

That means a court or a lawful judicial authority must have issued an order requiring an involuntary mental health commitment, according to CNN legal analyst Paul Callan, a former New York City homicide prosecutor.

"Unless there was some sort of a court order requiring involuntary commitment for mental health treatment, under existing gun control legislation, he could not be deprived of his constitutional right to possesses a weapon," Callan said.

Callan added, "People who submit to voluntary mental health treatment don't lose their right to possess firearms under current US law."

Callan said mental health authorities are required by law to warn potential targets of a possible violent attack if the patient reveals this during their treatment.

It's unknown how long Santiago spent in the medical facility for his mental evaluation and what it revealed.

Gun control laws pertaining to the mentally ill

Some states have adopted tougher restrictions than federal laws on gun ownership for people with mental health issues.

In Maryland, a person may not possess a regulated firearm if the person suffers from a mental disorder or "has a history of violent behavior" against other persons, according to the Washington, D.C.-based National Conference of State Legislatures

"Some other states include voluntary commitment in their barriers to gun ownership," said CNN legal analyst Danny Cevallos, a personal injury and criminal defense attorney.

In the District of Columbia , police have to confirm that a registration applicant "has not been voluntarily or involuntarily committed to any mental hospital or institution" in the five years immediately preceding the application. The applicant must present medical documents showing they have recovered from the mental issue that led to the commitment, according the law.

Alaska, however, follows the federal law on mental health and gun ownership.

Esteban Santiago

Santiago's brother, Bryan, told CNN in an interview he believed the shooting rampage stemmed from mental issues that surfaced after Santiago's 10-month tour in Iraq while serving in the Puerto Rico National Guard.

Santiago requested medical help from the military and federal agencies, his brother said. He received some treatment.

In Santiago's meeting with the FBI, he told them an intelligence agency was telling him to watch ISIS videos, law enforcement sources said. He said he didn't intend to harm anyone, the FBI said.

The FBI said it closed its assessment of Santiago after conducting database reviews, checking with other agencies and interviewing family members, according to a senior federal law enforcement official.

"There is a big difference between recognizing something is very off about a person and them being actually adjudicated with a mental defect or involuntarily committed," said Cevallos.