The National Rifle Association sued Florida over a new gun control law hours after Governor Rick Scott signed the legislation.

Spurred to action by a national outcry after the deadly shooting at Marjory Stoneman Douglas High School, Mr Scott and the Republican-controlled Florida legislature unified behind raising the age for buying all guns to 21. Previously, certain firearms could be purchased by 18-year-olds.

While gun control advocates hailed the new law, the National Rifle Association (NRA) called it an unconstitutional violation of the Second and Fourteenth amendments.

“At 18 years of age, law-abiding citizens in this country are considered adults for almost all purposes and certainly for the purposes of the exercise of fundamental constitutional rights”, a lawsuit filed by the NRA in a Florida district court said.

“This blanket ban violates the fundamental rights of thousands off responsible, law-abiding Florida citizens and is thus invalid”, the complaint said.

Representatives for Florida Attorney General Pam Bondi and Florida Department of Law Enforcement Director Rick Swearingen, the defendants in the lawsuit, did not respond to requests for comment. Student activists who survived the shooting and have since emerged as vocal gun control advocates reacted to the lawsuit with derision.

Florida shooting – in pictures Show all 10 1 /10 Florida shooting – in pictures Florida shooting – in pictures Police arrest a suspect in connection with the shooting at the Marjory Stoneman Douglas High School in Parkland, Florida Reuters Florida shooting – in pictures Parents wait for news after reports of a shooting at Marjory Stoneman Douglas High School in Parkland, Florida AP Florida shooting – in pictures Anxious family members wait for news of students AP Photo/Wilfredo Lee Florida shooting – in pictures Students being evacuated from the school AP Florida shooting – in pictures Students being evacuated from the school Getty Florida shooting – in pictures People gather waiting for word from students AP Florida shooting – in pictures Parents waiting for news on their children AP Florida shooting – in pictures People gather at a hotel where students were taken after the shooting Getty Florida shooting – in pictures Florida Governor Rick Scott speaks to the media as he visits Marjory Stoneman Douglas High School following the shooting AFP/Getty Florida shooting – in pictures Dr. Igor Nichiporenko, Medical Director Trauma, left, and Dr. Evan Boyer, Medical Director, Emergency Services, speak about treating victims and the suspect at a press conference outside Broward Health North hospital AP

“How am I not surprised”, student David Hogg wrote on Twitter.

Efforts to enact new gun control measures in response to prior mass shootings have faltered, in part because of the NRA’s immense political influence.

But the bloodshed in Parkland, Florida, during which a gunman killed 14 students and three school employees, has galvanised young people and unleashed political momentum for tougher gun laws. By rallying behind the measure, Mr Scott and fellow Florida Republicans showed a rare willingness to defy the NRA.

Donald Trump says the NRA 'have less power over me' during school safety discussion

So too did Donald Trump, who during a remarkable White House meeting embraced ideas that are anathema to the NRA - including stripping guns from people without due process - and has chastised legislators and governors for being “afraid” of the gun rights organisation.