TALLAHASSEE, Fla. – The National Rifle Association has filed a federal lawsuit over gun control legislation Gov. Rick Scott has signed, saying it violates the Second Amendment by raising the age to buy guns from 18 to 21.

The lawsuit came just hours after Scott, a Republican, signed the compromise bill Friday afternoon.

Lawyers for the NRA want a federal judge to block the new age restriction from taking effect.

The new legislation raises the minimum age to buy rifles from 18 to 21, 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. It also creates a so-called "guardian" program that enables teachers and other school employees to carry handguns.

"What I'm proud of in this state is that we reacted to a horrible situation. Our legislature came together, these families showed up. They were active, students were active, the state was active. We got historic legislation done. It's going to make our schools safer," Scott said after signing the bill into law.

The new measures come in the wake of the Feb. 14 shooting rampage at Marjory Stoneman Douglas High School in Parkland that killed 17 people and injured 17 others.