Andrew Gillum knows certain local gun restrictions are illegal under Florida law. He says communities should consider passing them anyway.

His reasoning has less to do with any short-lived policy victory or acquisition of moral high ground — and more to do with a claim that has become central to the Tallahassee mayor's candidacy for governor.

Gillum has taken the National Rifle Association to court, he says. And he's beaten them.

But it wasn't quite that simple.

Here's the legal background on the case Gillum likes to tout, and then we'll circle back to Gillum's intentionally illegal proposal.

In 2011, Florida passed a law that allows the Legislature to impose penalties on local officials who enact more restrictive gun policies than the ones passed by state lawmakers. Six years later, Florida Carry and the Second Amendment Foundation — two gun rights groups — sued the City of Tallahassee under that law for a decades-old ordinance that made it illegal to shoot guns in city parks. (The National Rifle Association filed an amicus brief in support of the gun groups in the case, Florida Carry, Inc. v. City of Tallahassee.)

Read more: Mayors in Florida face fines of $5,000 if they enact stricter rules on gun control

A Circuit Court appellate judge, George S. Reynolds, ruled in favor of the city. Hence, Gillum's claim that he, as Tallahassee's mayor, "beat" the NRA. But the judge only did so because Tallahassee failed to enforce the gun restrictions in question.

"While the ordinances may still be 'on the books,' they are unenforceable and invalid," Reynolds wrote at the time.

In other words: Pro-gun groups tried to get a gun law off the books. Gillum and the City of Tallahassee wanted to keep the law on the books. A judge ruled that the city could — but only because Tallahassee wasn't actually enforcing the law.

Gillum argued in a Tuesday interview that the city's victory mattered.

"If it was insignificant to the NRA, they would not have joined in (on the lawsuit)," Gillum said. "They like to purport since they lost that it was an insignificant fight. If it was insignificant, why did they engage in the fight in the first place?"

Insignificant or no, Gillum noted that the 2017 case could have implications for local governments today.

During its court battle with the gun groups, Tallahassee tried to argue that the 2011 state law that penalized local governments was unconstitutional because it violated, among other things, an individual legislator's right to free speech under the First Amendment. Judges dismissed that claim, arguing that Tallahassee had no legal standing because no official had actually born the brunt of the state Legislature's pre-emption law.

"Had this been a situation where Cross-Appellants/Appellees were penalized through a fine, denied the use of public funds for their legal defense, or removed from office by the Governor, the counterclaim would certainly need to be addressed," Reynolds wrote.

Gillum and the City of Tallahassee certainly did not win the fight against pre-emption — because that battle has yet to be fought.

Gillum wants to fight it. The Democratic candidate argues that, in order for a legislator to have legal standing to challenge state pre-emption laws, she might have to subject herself to its penalties. And that means breaking state law.

"If we do this all together, are they going to remove every mayor or city councilor? Well, they may…" Gillum said to the laughter of the few dozen attendees of his gun policy talk at St. Petersburg's Allendale United Methodist Church on Tuesday. "If they take that step then collectively we are ripe for a decision at a higher level as to whether or not that law is constitutional."

It's unclear whether this gambit will work — or whether local governments will even try it. But one thing is clear: at least for some at Tuesday's gathering, Gillum's messaging, however lacking in context, is landing.

"He's taken on the NRA," Edelyn Verona of Tampa, said of Gillum.

"And won," Elizabeth Corwin, also of Tampa, added.