TALLAHASSEE, Fla. — Florida Gov. Rick Scott signed into law sweeping changes to school safety and gun access Friday — a measure crafted in response to the Marjory Stoneman Douglas High School shooting.

And almost immediately, the National Rifle Association filed a federal lawsuit to block some of it from taking effect.

The new legislation raises the minimum age to buy rifles from 18 to 21, which the NRA claims violates the Second Amendment.

The law also extends a three-day waiting period for handgun purchases to include long guns and bans bump stocks that allow guns to mimic fully automatic fire. And it allows some school staffers to be armed.

The bill balances “our individual rights with need for public safety,” Scott said. “It’s an example to the entire country that government can, and has, moved fast.”

The changes were made in the wake of the Feb. 14 shooting rampage at the Parkland school that left 17 people dead and 17 more injured. The shooter, Nikolas Cruz, a 19-year-old who had previously exhibited mental health issues, used a legally purchased semiautomatic rifle in the attack.

Families of the victims watched as Scott signed the measure into law. Andrew Pollack, whose 18-year-old daughter, Meadow, was among the 14 students killed, said he and other parents plan “on moving forward and hitting every other state to make sure they follow the lead of Florida.”

Among other provisions of the new law:

It allows the arming of school staff who are not exclusively classroom teachers, including librarians, media specialists, coaches and counselors. The program is optional at the discretion of county sheriffs and school district superintendents.

The measure provides $400 million for mental health and school safety programs.

It requires every school in Florida to have a threat assessment team to meet monthly.

It establishes the Marjory Stoneman Douglas High School Public Safety Commission, which will investigate systemic failures in the Parkland school shooting and develop recommendations.

It creates a new legal process to take firearms from people who make violent threats against themselves or others.

The measure provides $400 million for mental health and school safety programs.

It requires every school in Florida to have a threat assessment team to meet monthly.

Most of the law takes effect immediately, although the ban on the sale and possession of bump stocks kicks in on Oct. 1, 2018, to give people who currently own them time to get rid of them.

Scott has disagreed from the beginning on arming school staff and hinted that some of the funding for this could be rerouted to hire more school resource officers.

“I still think law enforcement officers should be the ones to protect out schools,” he said. “I’ve already talked to the Florida Legislature about redirecting funds that aren’t used for this program for more law enforcement officers at our schools. If I veto the funding for this program now, this funding cannot be used for additional law enforcement officers this year.”

Read more from our friends at the NRA