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 importantly, a Georgia judge’s order committing him to mental health treatment against his will as a danger to himself and others in 2008 – Houser walked into an Alabama pawn shop six years later and bought a .40-caliber handgun.

It was the same weapon he used to kill two people and wound nine others before killing himself at a Thursday showing of “Trainwreck.” Three people remained hospitalized Saturday.

Court records 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.”

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.