CINCINNATI – How could the man accused of fatally shooting three in downtown Cincinnati on Thursday, a person who had a history of petty crime – and possible mental health issues – purchase a gun legally in Ohio?

Omar Santa Perez, 29, fatally shot three people and injured two others before he was shot and killed by police officers Thursday morning at Fifth Third Bank's corporate headquarters on Fountain Square.

Cincinnati Police Chief Eliot Isaac said Thursday that the 9mm semi-automatic pistol "appears to have been legally purchased."

No evidence has surfaced yet that would suggest Santa Perez should have been barred from owning a gun under federal or state laws.

Police are looking into Santa Perez's mental health. No specific diagnosis has been reported to date. Santa Perez sued CNBC and TD Ameritrade in 2017, but a judge dismissed his complaint as "rambling, difficult to decipher and borders on delusional."

Sept. 7:Woman survives after being shot 12 times in Cincinnati rampage

During a 2014 arrest in South Carolina, the officer found Santa Perez lying on the ground and smoking a cigar in front of a business that had fired him.

"The suspect appeared to be upset and disoriented. When I would ask the suspect questions but he would respond with strange answers,” the report said. “The suspect mumbled something about the war and the economy, but for the most part talked about that he was upset that he was terminated.”

Here's how Santa Perez could have obtained a gun legally.

First, Ohio and federal law do not ban people with mental health diagnoses from owning a firearm. They are banned only if a judge deems them to have a mental health issue or sends them to a mental health institution.

In those cases, the judge must report the person to the National Instant Criminal Background Check System or NICS. That system is checked every time a person purchases a gun.

Why not report all people with mental health issues? The National Alliance on Mental Illness estimates one in five adults in the United States experiences mental illness in a given year. That's a lot of people, most of whom would say they can safely wield guns for protection or sport.

Ohio Gov. John Kasich, a Republican, and Democrats have suggested adding a "red flag" law in Ohio. The law, which was passed in Florida after the Parkland high school shooting, would allow relatives or police to ask a judge to temporarily remove firearms from a person they fear might be a danger to others or himself.

That proposal has GOP lawmakers worried about guns being seized unnecessarily.

Sept. 6:Cincinnati gunman armed for 'bloodbath' kills 3

There's also no evidence so far that a "red flag" law would have helped in Cincinnati. The shooter's aunt, Yudy Martinez Perez, told The Cincinnati Enquirer that she didn't know why her godson would commit such a devastating crime. And his sole interaction with police here appears to be a traffic violation in 2015 for driving with an expired license plate.

In February 2017, President Donald Trump rolled back an Obama-era regulation that required the Social Security Administration to report the names of people unable to manage their finances because of a mental health condition to NICS. That would have banned some people with mental health issues from obtaining a firearm, but it's unlikely Santa would have been one of them.

Second, not all crimes disqualify a person from obtaining a gun.

Under Ohio law, a person is banned from purchasing or having a gun if they are indicted or convicted of a felony involving violence, drug use or drug sales.

Under federal law, a person is prohibited from having a gun if he is convicted of most crimes punishable by more than one year in prison. Those convicted of domestic violence (even a first-time offense) also are banned from obtaining a gun.

Santa Perez's record includes multiple low-level offenses: entering or refusing to leave the premises in Greenville, South Carolina; marijuana possession in Palm Beach, Florida; traffic offenses in Lake Worth, Florida; traffic offenses in Deerfield Beach, Florida; disorderly conduct in Coconut Creek, Florida, in addition to the traffic violation in Cincinnati in 2015.

If none of those crimes rose to the level of a felony, he would not have been barred from obtaining a gun.

Contributing: James Pilcher, Cameron Knight, Mark Curnutte, Terry DeMio, Sarah Brookbank, Max Londberg and Sheila Vilvens, The Cincinnati Enquirer. Follow Jessie Balmert on Twitter: @jbalmert