LAFAYETTE, La. — John Russell Houser was deeply troubled long before he shot 11 people in a movie theater in Louisiana, but decades of mental problems didn't keep him from buying the handgun he used.

Despite obvious and public signs of mental illness — most important, a Georgia judge's order committing him to mental health treatment against his will as a danger to himself and others in 2008 — Houser was able to walk into an Alabama pawn shop six years later and buy a .40-caliber handgun. It was the same weapon Houser used to kill two people and wound nine others before killing himself at a Thursday showing of "Trainwreck."

Two people remained hospitalized. Court records reviewed by The Associated Press strongly suggest Houser should have been reported to the state and federal databases used to keep people with serious mental illnesses from buying firearms, legal experts said.

"It sure does seem like something failed," said Judge Susan Tate, who presides over a probate court in Athens, Georgia, and has studied issues relating to weapons and the mentally ill. "I have no idea how he was able to get a firearm."

Related: Lafayette Movie Theater Shooter John Houser Should have Been Denied Gun: Gov. Jindal

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Houser never should have been able to buy a gun, said Sheriff Heath Taylor in Russell County, Alabama, whose office denied him a concealed weapons permit in 2006 based on arson and domestic violence allegations, even though the victims declined to pursue charges.

Houser racked up plenty of complaints, but no evidence has surfaced of any criminal conviction that would have kept him from passing the background check required for many gun purchases. Federal law does generally prohibit the purchase or possession of a firearm by anyone who has ever been involuntarily committed for mental health treatment.

That's what happened to Houser in 2008 after his family accused him of threatening behavior, warning authorities that he had a history of bipolar disorder and was making ominous statements. His wife removed his guns and together, the family persuaded a judge to issue a protective order keeping him away once he left the hospital.

At that point, court officials should have reported Houser's involuntary mental commitment to the Georgia database that feeds the FBI's background check system, which provides for a delay of up to three days when records suggest a buyer may be ineligible.

When Houser tried to buy his gun on Feb. 26, 2014, the system only briefly delayed his purchase, according to a federal official who spoke on the condition of anonymity because of the ongoing investigation. The seller was advised the following day that the sale could proceed.

Related: Brother of Louisiana Theater Shooter: 'We Saw No Sign of This'

It was Carroll County Probate Judge Betty Cason who authorized authorities to detain Houser in 2008, according to court records. Her court also issued the order involuntarily committing Houser to the West Central Regional Hospital in Columbus, according to legal filings from an attorney representing Houser's wife and other family members.

Judge Tate, who was not involved in Houser's case, said an involuntarily commitment order normally prompts a judge to file a report with the Georgia Crime Information Center, which keeps about 5,000 records on people who cannot buy guns because they have been judged insane, involuntarily hospitalized or legally depend on someone else to manage their affairs. Those state records feed the FBI's database.

It was not clear whether Cason filed such a report. She did not return a phone message seeking comment.

Like many states, Georgia has a highly decentralized court system, spread over 159 counties. Experts have long worried that probate judges are not reporting every mental health commitment. The former director of Georgia's criminal records database, Terry Gibbons, wrote in a 2013 email obtained by the AP that "some courts are reluctant to report mental health records due to perceived privacy/HIPPA concerns."

Gibbons has since retired and could not be reached for comment over the weekend.

"I suspect there may be some courts where the reporting is not done because they are just having trouble keeping up with the day-to-day work of people coming into their offices needing their help," Tate said.