Florida Attorney General Ashley Moody is asking a federal judge to toss out a lawsuit filed by the National Rifle Association challenging gun legislation passed after the 2018 mass shooting at Marjory Stoneman Douglas High School that killed 14 students and three faculty members.

The national gun rights group challenged part of a sweeping school-safety law that raised the age to purchase rifles and other long guns from 18 to 21.

But in a motion to dismiss the case filed Tuesday, Moody's lawyers argued that the law doesn't violate the Second Amendment because, while individuals who are between ages 18 and 21 cannot buy guns, they may still "keep and use" firearms "for any lawful purpose."

The Republican-controlled Legislature passed the higher minimum age to buy long guns, a restriction already in place for handguns, in part as a reaction to the Parkland school shooting. Accused killer Nikolas Cruz, a former student at the school who was 19 years old at the time of the shooting, legally purchased the AR-15-style rifle that was used.

The lawsuit, filed immediately following passage of the law in 2018, languished for more than a year in federal court but is back on track after the NRA dropped an attempt to keep secret the identities of two plaintiffs.

The gun-rights organization alleges that the age restriction is an unconstitutional violation of people's Second Amendment right to "purchase firearms to defend themselves, their families, and their homes."

"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," the NRA's lawyers wrote in a brief filed in November. "At 18, citizens are eligible to serve in the military — to fight and die by arms for the country."

But in the 36-page motion filed Tuesday, lawyers for Moody argued that Chief U.S. District Judge Mark Walker should dismiss the complaint "because it fails to state a claim upon which relief may be granted."

Noting that "a 19-year-old used a lawfully purchased firearm to kill 17 students and faculty members" at the Parkland school, Moody's lawyers wrote that Florida legislators were "responding to that and other incidents of gun violence" when they crafted the statute.

The state's "age qualification is fully consistent with the historical understanding of the scope of the Second Amendment right," the attorney general's lawyers wrote.

"Florida does not ban 18-to-20-year-olds from possessing firearms, and a prohibition on those individuals' purchase of firearms expires once they reach 21. In light of the important governmental objective at stake and the carefully targeted age qualification, the statute easily passes intermediate scrutiny," the standard by which it should be judged, the lawyers added.

Moody's lawyers also asked that she be dismissed from the case, which names her and Florida Department of Law Enforcement Commissioner Rick Swearingen as defendants, "because she is not authorized to enforce the challenged provision."

In the November court filing, the NRA argued the "age-based ban" imposes "a significant, unequal, and impermissible burden on the right to keep and bear arms of a class of millions of law-abiding 18-to-21-year-old citizens."

But in Tuesday's motion, Moody's legal team wrote that the statute "does not burden conduct within the scope of the Second Amendment," and, even if it does, "it survives the applicable level of scrutiny."

"Any law-abiding person over the age of 18 may gift, loan, or allow the use of a firearm to an otherwise qualified person over the age of 18, who may in turn keep and use that firearm for any lawful purpose, including home defense, hunting, sport and practice shooting," the motion said. "The sale-gift distinction is aimed at a uniquely dangerous problem — the purchase of firearms by 18-to-20-year-olds absent the judgment of a parent, guardian, or other law-abiding adult that the individual is prepared for the responsibility of gun ownership."

Moody's lawyers also said the law doesn't violate equal protection rights, as the NRA argued, because there is a rational basis for the age classification.

Finally, the attorney general's lawyers argued that she has no authority to enforce the law. Instead, "it is the locally elected state attorney" who would prosecute violations of the law, they wrote.

"The attorney general does have considerable authority to act in the public interest and, when necessary, to defend state statutes. She is the only official authorized to represent Florida's state interests in federal court, and she may intervene in cases 'in which the state may be a party, or in anywise interested.' … But that authority is wholly discretionary," her lawyers wrote. "And forcing the attorney general to defend the constitutionality of a statute would effectively eliminate her unreviewable discretion to intervene."

Dara Kam reports for the News Service of Florida.