A federal judge has temporarily blocked a sheriff in Georgia from placing signs at three registered sex offenders’ homes that warn trick-or-treaters on Halloween, saying that the action violated their constitutional rights.

Judge Marc T. Treadwel l of the United States District Court for the Middle District of Georgia filed a temporary injunction on Tuesday in favor of the offenders who sued Sheriff Gary Long of Butts County and his office for placing signs that said “Warning! No Trick-or-Treat at this address!!”

“The question the court must answer is not whether Sheriff Long’s plan is wise or moral, or whether it makes penological sense. Rather, the question is whether Sheriff Long’s plan runs afoul of the First Amendment of the United States Constitution,” Judge Treadwell wrote in his opinion. “It does.”

A lawyer for the three men in the lawsuit filed last month, Mark Yurachek, said in a statement he was “thankful for the court’s thoughtful and measured decision.”