Florida Gov. Rick Scott (R) signed gun restrictions and school safety measures into law on Friday, a response to the mass shooting at Marjory Stoneman Douglas High School in Parkland, Florida, that left 17 dead.

“Every student in Florida has the right to learn in a safe environment, and every parent has the right to send their kids to school knowing that they will return safely at the end of the day,” Scott said Friday. “Today, I am signing bipartisan legislation that helps us achieve that.”

The law contains new gun control restrictions, including raising the age to buy firearms to 21, imposing a three-day waiting period on most firearms purchases, and banning bump stocks — all provisions staunchly opposed by the National Rifle Association in a state where it’s used to getting its way. But the bill also includes a controversial provision to allow certain school employees to carry guns as part of new school security measures.

The legislation passed the Florida House and Senate this week after contentious debate. Scott had not committed to signing the legislation, saying he would review the bill and meet with the Parkland victims’ families before making his decision. According to the Tampa Bay Times, all 17 families of Parkland victims have supported the legislation.

Scott signed the law despite reservations about the program to train and arm some school employees. He had staunchly come out against arming teachers, but Florida’s Senate struck a compromise Monday that excluded full-time educators from participating in the program. Instead, it opens up the program to other school officials, from coaches to counselors to librarians. The Senate named it the Coach Aaron Feis Guardian Program, in honor of the football coach at Stoneman Douglas who died shielding students from the gunman’s bullets.

The governor also defied the NRA. Scott, who’s expected to run for Senate this fall, has an A+ rating from the NRA and has otherwise overseen the loosening of gun restrictions during his tenure.

Florida has long been a trailblazer on gun rights legislation. The state’s concealed carry law in 1987 became a national model. So did its 2005 “stand your ground” law. Bucking the NRA to pass new restrictions on gun purchases marks a significant shift for the state.

Now, Scott has now signed into the law the first gun control measures in Florida in more than two decades.

Florida starts a voluntary program to arm school employees

The legislation originally directed $67 million to a “school marshal” program to train and arm teachers. The controversial proposal drew opposition from Democrats and even some Republicans. (Gov. Scott also came out against the idea.)

To sidestep the controversy, lawmakers struck a deal to prevent most classroom teachers from being able to participate. Instead, the bill calls for other school employees — such as librarians and coaches — to be armed instead. They also rebranded it as a “school guardianship” program.

The program is voluntary, and school boards or superintendents would decide whether to participate and sponsor employees to undergo training with the local sheriff’s department.

Eligible employees would undergo 132 hours of training, including firearms safety and active-shooter drills; go through mental health screening, background checks, and drug tests; and officially become sworn officers with the local sheriff’s office.

Staffers who become trained marshals would get a $500 stipend. Republican Rep. José Oliva, who sponsored the initial legislation that involved teachers, indicated it’s up to school boards or superintendents whether participants would have to purchase their own firearms or whether the district would buy them.

Florida’s guardianship program hews closely to one already in existence in Central Florida’s Polk County, sponsored by a local sheriff. The Ledger, a newspaper in Polk County, reported that only Southeastern University, a private college, participates, with nine staff members as trained special deputies authorized to carry weapons.

Oliva pointed this out in his closing remarks on the House floor Wednesday, saying the guardianship program would put in place a “rigorous set of standards” schools must meet.

“If you choose to do it, if you volunteer to do, this is the way you’re going to do it,” he said.

At least eight US states currently allow, or at least don’t have a law prohibiting, people with concealed carry permits to bring guns onto K-12 campuses, according to the Giffords Law Center to Prevent Gun Violence.

Texas probably has the closest model to what Florida just passed. President Donald Trump, who has pushed the idea of arming teachers in the wake of the Parkland shooting, referenced the Texas policy in his meeting with state governors in February.

In 2013, following the massacre at Sandy Hook Elementary School in Newtown, Connecticut, the state passed the Protection of Texas Children Act, which allows educators to undergo firearm and active-shooter training to carry concealed weapons. The Houston Chronicle reports that at least 172 of Texas’s 1,200 school districts have implemented the policy, though they’re mostly in rural school districts where local law enforcement presence on campus is rare.

As German Lopez has written for Vox, there’s no good research that supports the idea that arming teachers or other school employees could effectively prevent mass shootings. It is also extremely difficult to stop mass shooting events, even with extensive firearm training.

But there is plenty of research to suggest that adding more deadly weapons increases the chances of violence. Critics have also pointed out the increased potential for accidents or unintentional shootings in volatile situations. An investigation by the Tampa Bay Times found at least 19 incidents in which school counselors and other employees who could potentially be armed under this new legislation threatened others with violence.

The law also includes new restrictions on gun purchases

The legislation isn’t all about toughening school security and arming staffers. It would put some restrictions on gun purchases and provide schools with mental health counseling and safety funding. The bill would:

Raise the minimum age to purchase firearms from licensed dealers to 21, though active military, law enforcement, and correctional officers would be exempt. (People under 21 can still possess a firearm, however.) Federal law mandates that people under the age of 21 can’t buy handguns from licensed dealers, though adults 18 and older can buy long guns such as rifles and shotguns from licensed dealers. Some states have stricter requirements; Hawaii and Illinois also ban the purchase of rifles and shotguns from licensed dealers by people under 21, according to data from the Giffords Law Center to Prevent Gun Violence.

Require a three-day waiting period on firearm purchases from licensed dealers, or until record checks are complete, whichever comes later. (There are a few exemptions, including for concealed carry permit holders.)

Ban the sale and possession of bump stocks, devices that effectively convert a semiautomatic weapon into an automatic one.

Allow police to petition in court for a risk protection order, which would let authorities restrict firearm and ammunition possession for those considered a danger to themselves or others. Such an order could be extended for up to a year. This is similar to what are called “red flag” laws, which exist in California, Oregon, Indiana, Connecticut, and Washington. (Rhode Island’s governor just signed an executive order to implement such a law after the Parkland shooting.) In these situations, a judge can intervene — usually after being alerted by police or a family member or friend — and temporarily confiscate guns from people who have threatened violence.

Provide $400 million in funding for school mental health and counseling programs and other school safety programs — including more support for school resource officers.

Florida’s bill tackles some of the glaring failures before the Parkland shooting. The shooter, a 19-year-old, could legally purchase an assault-style rifle — which Florida’s new law would prevent. It’s not clear how far this provision will actually go to prevent mass shootings; according to data from Everytown for Gun Safety, a gun control advocacy group, people under 21 carried out two of 156 mass shootings (four or more people shot and killed) between 2009 and 2016.

The risk protection order — which would temporarily seize firearms from people deemed a threat by a judge — also targets a system breakdown in preventing a shooting like the one in Parkland. Local law enforcement received multiple tips about the Parkland shooter, and the FBI was also notified that he might be dangerous. The measure Florida passed would give family, friends, and police more opportunities to intervene (at least in theory), even if a person hasn’t been adjudicated regarding a mental illness.

What the law doesn’t do

But Florida’s legislation doesn’t include the big-ticket item desired by many Parkland activists: an assault weapons ban.

In a bizarre sequence over the weekend, Florida senators appeared to approve a two-year moratorium on the sale of AR-15-style weapons in a voice vote. However, the Senate considered the motion with a roll call vote right after. That vote came up short — 17 to 21 in favor — and the measure ultimately failed.

Two-thirds of Florida voters support an assault weapons ban, but as Mary Ellen Klas explains in the Tampa Bay Times, while Republicans in swing districts are more receptive to a ban, they’re outnumbered by those in solidly red districts whose pro-gun-rights voters may be more likely to mobilize on the issue.

For now, it seems as if gun control advocates will take the partial victory in anticipation of a more protracted battle to come on an assault weapons ban. “This is with a heavy heart to vote for this bill knowing it’s not enough,” Rep. Matt Willhite said on the House floor Wednesday.

This also isn’t a sign that Florida is about to reverse its position as a gun-friendly state. “I still think you’ll definitely see the Second Amendment is still the strong thing in Florida,” Susan MacManus, a political science professor at the University of South Florida, told Vox last week. “It’s just that the emphasis has turned to mental health and hardening the schools, that kind of thing.”

But, she adds, “It’s not an all-or-nothing thing. It is incremental. That’s the way major public policy in this country is made.”

Update: This post has been updated to include Scott’s statement.