A federal judge on Tuesday said a Georgia sheriff’s plan to post “no trick-or-treating” signs at sex offenders’ homes was unconstitutional.

The ruling comes after three registered sex offenders sued Butts County Sheriff Gary Long to stop his office from the practice, which began last year with deputies planting signs that urged Halloween revelers against stopping. Deputies put up some of the signs while others among the county's 200 registered sex offenders were told to display one themselves or face unspecified trouble, according to the complaint.

U.S. District Court Judge Marc T. Treadwell’s order applies only to the three plaintiffs, meaning it wouldn’t stop the sheriff’s office from placing signs at other registered sex offenders’ homes. But the judge said Long’s legal authority to place the signs was “dubious at best.”

The sheriff disagreed with the ruling but said he’d abide by it. He said he had deputies put the signs up last year because a popular trick-or-treating event on the square in downtown Jackson was cancelled, leading to an increase in door-to-door visits.

“While the vast majority of us may disagree with the Judge’s ruling, I strongly encourage you to NOT take matters into your own hands this Halloween,” Long wrote on Facebook. “Unfortunately, there is no time to appeal before this Halloween.”

Treadwell said the three men who sued are “by all accounts” rehabilitated and living law-abiding lives.

“Yet their Sheriff finds it necessary to post signs in front of their homes announcing to the public that their homes are dangerous for children,” the judge wrote. “The Sheriff’s decision is not based on any determination that the Plaintiffs are dangerous. Nor is the Sheriff’s sign-posting founded on Georgia law.”

The sheriff’s plan to place the signs “run afoul” of the First Amendment because it compels the men to display the message even though they disagree with it.

The sheriff said he’d sought legal advice in 2018 before placing the signs and believed it was appropriate.

The lawsuit itself, which seeks unspecified damages for the three men, is still pending.