The Florida Supreme Court rejected a challenge to a state law on Thursday that prevents local officials from implementing restrictions on gun and ammunition sales. 

Florida passed a law in 1987 that preempts cities and counties from creating restrictions on guns that go beyond state law, then added civil penalties and fines for local officials who violate that law in 2011. 

Several local governments challenged the penalty provision of the law after 17 people were shot and killed at Marjory Stoneman Douglas High School in 2018. Former Democratic Agriculture Commissioner Nikki Fried, who left office earlier this month, joined multiple municipalities in suing the state. 

Florida gun store

Firearm store located in Florida.  (BSIP/Universal Images Group via Getty Images)

The penalty provision calls for a fine of up to $5,000 against any local official for "knowing and willful" violations of the statute. 

SEMIAUTOMATIC WEAPONS BAN BECOMES ILLINOIS LAW

In a 4-1 ruling, the Florida Supreme Court ruled against those local officials, with the majority writing that "local governments have no lawful discretion or authority to enact ordinances that violate state preemption."

Florida guns

Luiz Santos prepares to load a pistol at the Pembroke Gun & Range shop in Pembroke Park, Florida. (Joe Raedle/Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

Florida Attorney General Ashley Moody called the ruling a "big win" on Thursday. 

"Our attorneys fought hard to make sure local governments can’t trample on your 2nd Amendment rights," she tweeted.