The National Rifle Association has filed a federal lawsuit over gun control legislation Florida Gov. Rick Scott has signed, saying it violates the Second Amendment by raising the age to buy guns from 18 to 21. The new measures come in the wake of the Feb. 14 shooting at Marjory Stoneman Douglas High School in Parkland, Florida, that killed 17 people.

The lawsuit came just hours after Gov. Scott, a Republican, signed the compromise bill Friday afternoon. It was passed by the House and Senate earlier this week.

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.

The bill, which provides new mental health programs for schools and provisions to keep guns away from people who show signs of mental illness or violent behavior, CBS Tallahassee affiliate WCTV reports. It extends a three-day waiting period for handgun purchases to include long guns and bump stocks that allow guns to mimic fully automatic fire.

Get Breaking News Delivered to Your Inbox

The legislation also includes a controversial provision, which would allow "dual role" teachers - teachers who have a role in the school outside of the classroom, such as a coach - or others with military or law enforcement background, to volunteer to carry a weapon on school campuses.

Andrew Pollack, whose daughter Meadow was among those killed at the high scool, pushed for the controversial provision, which is named for coach Aaron Feis, who died charging the gunman, WCTV reports.

"He almost got this guy, cause I know someone who saw it on video," Pollack said. "Just one second difference, this coach Feis could have grabbed this piece of garbage. He would have got him."