(Reuters) - Florida Governor Rick Scott, a staunch ally of the National Rifle Association (NRA), signed into law on Friday a bill imposing a 21-year-old legal age requirement and three-day waiting period on all gun purchases and allowing the arming of some school employees.

Within hours, the NRA filed a court challenge to provisions raising the legal age for buying a rifle or shotgun, asserting that the higher requirement - consistent with the minimum age nationally for handgun purchases - violates the U.S. Constitution.

Final passage of the bill by state lawmakers came three weeks to the day after a gunman opened fire with a semiautomatic assault-style rifle at Marjory Stoneman Douglas High School Public in Parkland, Florida, killing 14 students and three faculty members.

Swift action in the Republican-controlled statehouse, where the powerful NRA gun lobbying organization has long held sway, was propelled in large part by an extraordinary counter-lobbying campaign waged by young survivors from the massacre and parents of the victims.

The Parkland massacre and response to it by Florida lawmakers signaled a possible turning point in the national debate between advocates for tougher firearms restrictions and proponents of the right to bear arms as enshrined in the Second Amendment of the U.S. Constitution.

Gun control supporters said the tragedy - the deadliest U.S. high school shooting ever - has given new momentum to firearms-safety measures pending in at least two dozen states, many in solidly conservative parts of the nation.

“Today should serve as an example to the entire country that government can and must move fast,” Scott said in remarks before the signing, surrounded by survivors of the shooting and their families.

One of them, Andrew Pollack, whose daughter Meadow was among those killed, hailed the bill as “a start.”

“We’re going to work on moving forward and hitting every other state to make sure they follow the lead of Florida,” he told reporters.

FILE PHOTO - Florida Governor Rick Scott listens during a meeting with law enforcement, mental health, and education officials about how to prevent future tragedies in the wake of last week's mass shooting at Marjory Stoneman Douglas High School, at the Capitol in Tallahassee, Florida, U.S., February 20, 2018. REUTERS/Colin Hackley

Scott, a Republican who received the NRA’s endorsement as governor and its highest rating for supporting the rights of gun owners, said the bill represented a compromise balancing concerns on both sides of the gun debate.

The NRA’s lawsuit, filed in U.S. District Court in Tallahassee, said that barring adults under the age of 21 from buying rifles was unconstitutional, violating both the Second Amendment and Americans’ 14th Amendment rights to equal protection under the law.

A statement issued earlier by the NRA had derided the higher minimum age and new waiting period for rifle sales as a prescription that “punishes law-abiding gun owners for the criminal acts of a deranged individual.”

Still, other states appeared ready to follow Florida’s lead on at least some new gun-safety measures.

Five states - Alabama, Kentucky, Pennsylvania, Rhode Island and Utah - have seen so-called “red flag” bills introduced since the Florida massacre to make it easier for police to confiscate weapons from someone found to pose a threat of violent behavior, according to Kristin Brown, co-president of the Brady Campaign to Prevent Gun Violence.

Such a provision was included in the Florida package enacted on Friday.

The legislation, while containing a number of other provisions student activists and their parents from Parkland had embraced, left out one of their chief demands - a ban on assault-style weapons like the one used in the Feb. 14 rampage.

ARMING SCHOOL PERSONNEL

The bill also was controversial for including provisions allowing school staff to be specially trained and deputized to carry guns on the job as campus “guardians,” though local sheriffs and individual school districts may opt out of the program if they wish.

Most classroom teachers are excluded from volunteering for the program, a compromise aimed at earning the support of the governor, and many lawmakers, who opposed the idea.

“My daughter is a teacher, and I believe teachers should teach,” governor said. The bill left only non-teacher staff eligible to participate, such as administrators, guidance counselors, librarians and coaches.

Florida now joins at least six other states - Georgia, Kansas, South Dakota, Tennessee, Texas and Wyoming - with laws allowing public school employees to carry firearms to work, according to the National Conference of State Legislatures.

President Donald Trump has voiced support for the idea, also espoused by the NRA.

Critics have said arming school staff only heightens the risks of gun violence, and poses a particular risk to minority students, who they said were more likely to be shot in the heat of a disciplinary situation or if mistaken as an intruder.

Scott said he remained dissatisfied with the guardian provisions but signed the bill nonetheless, saying it would enhance school safety overall.

“I am glad, however, that the plan in this bill is not mandatory, which means it will be up to locally elected officials,” Scott said.

Besides his objections to arming teachers, Scott was on record as being opposed to extending Florida’s existing three-day waiting period for handgun sales to purchases of all firearms, as the new law now does.

The measure also raises the legal age for all gun purchases to 21. The minimum age for handguns nationally is 21, but a person as young as 18 previously could buy a rifle in Florida.

Nikolas Cruz, the accused gunman charged with 17 counts of premeditated murder in the Parkland shooting, was 18 years old when he legally purchased the AR-15 assault-style rifle used in the massacre, according to authorities.

Cruz, now 19, had a history of mental issues, numerous encounters with police and was expelled from Stoneman Douglas last year for disciplinary problems, according to authorities.