The Wednesday night shooting massacre at a Thousand Oaks country music bar was the kind of tragedy that would seem more likely in states such as Nevada or Florida known for permissive gun regulations that allow military-style semiautomatic rifles and high-capacity ammunition magazines.

But it happened in California, seen as a model for firearm regulation and the only state given an “A” rating by the Giffords Law Center to Prevent Gun Violence’s annual gun law score card.

The shooting that took 13 lives, including the alleged gunman who authorities said apparently killed himself, immediately sparked debate over the effectiveness of gun regulations and whether new or different laws or enforcement efforts are needed.

“This can’t be normalized,” Governor-elect Gavin Newsom said of the shootings at a Thursday morning news conference in San Francisco. “This is America, it’s got to change. This doesn’t happen anywhere else on the planet. The response cannot just be more prayers, more excuses. It sure as hell cannot be more guns.”

But gun-rights advocates said Thursday that the shooting shows human behavior, not guns, is the problem.

“Gun control proponents like Gavin Newsom are irrationally committed to passing more and more laws that just don’t prevent violent people from doing evil things,” said Brandon Combs, president of the Firearms Policy Coalition. “He and other anti-gun advocates are the embodiment of insanity, doing the same things over and over again while expecting different results.”

In many ways, Wednesday night’s shooting seemed like something California law would have hindered.

The alleged gunman, identified as a 28-year-old U.S. Marine Corps veteran, was armed with a legally purchased Glock .45-caliber handgun modified with what law enforcement officials called an “extended magazine” that holds additional rounds of ammunition. The gun’s standard magazine would hold 13 rounds, and an extended magazine would hold more. California law limits magazines to a 10-round capacity, but that law is on hold due to a legal challenge from gun-rights advocates.

California in 2014 also became the first state to enact a Gun Violence Restraining Order law allowing concerned family members to petition a court to temporarily remove firearms from a relative who is found to pose a clear danger to the public or their own safety during a mental crisis.

But there was no indication such an intervention was sought in this case — even though the Thousand Oaks gunman had a history of mental health problems that had led to visits from law enforcement. Neighbors said that the gunman suffered from post-traumatic stress disorder.

After a neighbor reported loud noises coming from the shooter’s house in April, deputies responded and found a man “acting a little irrationally.” They called a mental health specialist who assessed him but concluded he couldn’t be involuntarily committed for psychiatric observation.

A neighbor told CNN that the gunman’s mother “lived in fear” of what her son might do and that when police were called to the house earlier this year “it took them about a half a day to get him out of the house.”

The neighbor, Richard Berge, said the shooter’s mother told him that while she didn’t fear for her own safety, she was concerned about her son and “kind of beside herself, she didn’t know what to do because he wouldn’t get help.”

Garen J. Wintemute, an emergency medicine physician at UC Davis Medical Center and director of the Violence Prevention Research Program, said there was nothing in the gunman’s record that would have prevented him from arming himself.

“He wasn’t a prohibited person, and the ban on possession of high-capacity magazines is tied up in court,” Wintemute said. But he added that a Gun Violence Restraining Order “would have been useful and might have come into play in April.”

Wednesday’s tragedy was the deadliest U.S. mass shooting since Feb. 14 when an expelled 19-year-old student allegedly killed 17 classmates and faculty at his former high school in Parkland, Florida, a Valentine’s Day massacre that renewed the national debate over gun laws.

And it followed a string of other mass shootings around the country, including a gunman who massacred 11 people at a Pittsburgh synagogue last month.

California has long been a leader in enacting gun restrictions inspired by tragedies, including the 1989 shooting of five schoolchildren at a Stockton elementary school and the 1993 shooting of eight people at a San Francisco law office. Those mass shootings led the state to ban military-style semiautomatic “assault weapons,” as well as a U.S. ban that was allowed to expire in 2004 after a federal study found inconclusive evidence of its effectiveness.

In addition to the bans on assault weapons and high-capacity magazines and the gun violence restraining orders, California gun laws include a 10-day waiting period on gun purchases and requiring buyers to obtain a safety certificate after passing a written test.

Others laws require background checks on gun buyers, limit handgun purchases to one a month, licensing all gun dealers, requiring records of all firearm sales, banning inexpensive “Saturday night special” handguns as unsafe, and allowing local authorities to deny a concealed carry permit. Ammunition must be bought from a licensed dealer.

California has a one-of-a-kind Armed and Prohibited Persons System, developed in 1999 and updated in 2006, that is designed to keep guns out of the hands of convicted criminals and the mentally ill. It automatically tracks firearm owners and disarms convicted criminals, people with certain mental illnesses, and others deemed dangerous.

Gov. Jerry Brown signed a number of new gun regulations this year, including one raising the age to legally buy rifles from 18 to 21, the same age the state requires for handgun purchases.

Advocates say the thicket of firearm regulations has helped — California ranks 43rd out of the 50 states in gun deaths per capita, according to the Giffords Law Center to Prevent Gun Violence.

Even so, California continues to see its share of mass shootings. In March, a former soldier fatally shot three mental health workers with a rifle at a veterans home in Yountville before taking his own life. In November 2017, a deranged man with a history of criminal violence and barred from owning guns fatally shot five people in Tehama County with an assault rifle before being killed by police.

And in December 2015, a married couple armed with military-style assault rifles and semiautomatic pistols fatally shot 14 people in a terrorist attack at a San Bernardino County holiday party before being killed by police.

The San Bernardino couple, inspired by the Islamic State, got the rifles from a friend who bought them legally at the time in California. The Tehama County gunman used a home-made “ghost gun” built from parts that can be legally purchased.

U.S. Sen. Dianne Feinstein, who has made a career out of pushing for tighter gun restrictions, said Thursday that the country’s spate of mass shootings have one thing in common: “easy access to guns.”

“Some will say California’s strong gun laws didn’t prevent this shooting,” Feinstein said in a statement. “But without stronger federal gun regulations, there’s little California can do to keep guns coming in from other states.”

The Thousand Oaks gunman, however, used a common semiautomatic pistol that authorities said he bought legally in Ventura. It was unclear where or how he got the extended magazine, which Ventura County Sheriff Geoff Dean called illegal. The sheriff lost one of his own deputies in the shooting, compounding the tragedy that fell on Dean’s last week on the job before he retires after 40 years.

“It can’t be any worse,” the sheriff said.

Staff Writer Casey Tolan, CNN and the Associated Press contributed to this report.