A Missouri law aimed at keeping children away from sex offenders on Halloween night can be enforced in its entirety after a federal appeals court order Thursday, Attorney General Jay Nixon said.

The order means that the state's registered sex offenders do need to remain inside their homes from 5 to 10:30 p.m. Friday night unless they have "just cause" to leave, such as for work or a medical emergency. They must keep their outside lights off and post a sign saying they aren't distributing candy. They may not have any Halloween-related contact with children.

A three-judge panel of the 8th U.S. Circuit Court of Appeals on Thursday stayed, or put on hold, a lower court's ruling until it can consider the state's appeal and rule on the merits — sometime before next Halloween.

U.S. District Judge Carol Jackson earlier this week ruled that two of four provisions in the law could not be enforced this Halloween.

The stay had been sought by Republican Gov. Matt Blunt and Nixon, a Democrat.

"This stay comes not a moment too soon, as hundreds of thousands of Missouri children prepare to go trick-or-treating Friday night," Nixon said in a statement. He said his office will continue efforts to uphold the law and is advising the state's law enforcement agencies of the order.

Blunt also applauded the decision but warned parents to remain vigilant.

"I want Missouri parents to know that Missouri's law enforcement community is doing all they can to ensure a safe Halloween for Missouri's trick-or-treaters, but we must all remember the new law and related changes are not meant to replace parental vigilance," Blunt said in a statement.

There have been different opinions this week about how the law should be applied.

The Missouri State Highway Patrol said Wednesday it believed the law only applied to sex offenders convicted after Aug. 28, when the law took effect, saying the law could not be applied retroactively.

But on Thursday, the Patrol's Lt. John Hotz said that because the Attorney General's office has said the law is enforceable, the Patrol will report any violations to local prosecutors, even if the offender was convicted prior to Aug. 28, and let prosecutors determine if charges should be pursued.

The American Civil Liberties Union of Eastern Missouri said it will continue legal action on behalf of four unnamed sex offenders to have the law taken off the books.

The ACLU has argued that the law is unclear, and left offenders unsure about what they can and cannot do on Halloween.

"I think police officers will act reasonably, and understand there's confusion," the ACLU's Tony Rothert said.

The Missouri Department of Corrections has said that convicted sex offenders on probation and parole have been instructed about any Halloween restrictions that they must follow, regardless of the legal dispute. That's permissible because those offenders are still under state supervision.