A federal judge ruled Sunday that anonymous teenage plaintiffs helping to challenge Florida's sweeping anti-gun law must identify themselves publicly, even as he acknowledged the order would probably expose them to intense leftist "vitriol" and "harassment."

In a surprising turn, U.S. District Judge Mark Walker even suggested that he personally wanted to side with the NRA, which wants to shield the young plaintiffs' identities, but said his hands were ultimately tied by court precedent.

"If it were entirely up to this court, the court would not hesitate to grant the NRA's motion," Walker wrote in his ruling. "One need only look to the harassment suffered by some of the Parkland shooting survivors to appreciate the vitriol that has infected public discourse about the Second Amendment. And this court has no doubt the harassment goes both ways."

The NRA filed the lawsuit on Second Amendment grounds soon after Florida lawmakers approved gun legislation that would raise the age to buy guns to 21 years old. The age restriction is one part of a larger anti-gun bill signed by Gov. Rick Scott in the wake of the February shooting at Marjory Stoneman Douglas High School that left 17 dead.

THIESSEN: CORPORATE BOYCOTTS OF NRA ARE REALLY BOYCOTTS OF UPSTANDING AMERICANS

Citing the harassment of one of its top Florida officials who was subjecting to threatening and profanity-laced emails and phone calls, attorneys for the NRA wanted to include a 19-year-old woman as a plaintiff in the lawsuit but wanted to keep her name confidential and instead identify her as Jane Doe.

The NRA also sought to include testimony from another 19-year-old man as well. The move was challenged by Attorney General Pam Bondi.

The NRA has been in the crosshairs of anti-gun activists for the past several months, with Parkland shooting survivor David Hogg leading boycotts of corporations and politicians who refuse to summarily cut ties with the organization.

Anti-gun rhetoric has markedly intensified as well. Earlier this year, a Florida billboard calling the NRA a “terrorist organization" was funded by a former White House staffer for President Bill Clinton. That criticism was echoed in March by Connecticut Democratic Gov. Dannel Malloy, who said the NRA has "in essence become a terrorist organization."

NRA BREAKS 15-YEAR FUNDRAISING RECORDS, FILINGS SHOW

Marion Hammer, a former president of the NRA and its top Florida lobbyist, said the NRA was "very disappointed" in the judge's decision, but said that it was "too soon" to know what steps the organization would take next.

"We're trying to shield these young adults from some of the most evil, hateful stuff you can imagine," Hammer said in an email. "... Individuals should be able to stand up for their rights and beliefs in the Second Amendment without having to expose themselves to harassment and bullying."

The Associated Press contributed to this report.