ALBANY, N.Y. (CBSNewYork/AP) — The highest court in New York state ruled Tuesday that state law is what determines where sex offenders can live — and not the more than 100 municipal ordinances setting boundaries around parks, schools and other areas where children are likely to gather.

The Court of Appeals ruled unanimously in a case out of Nassau County on Long Island, saying New York state’s “comprehensive and detailed” regulations for identifying, restricting and monitoring registered sex offenders prohibit localities from enacting their own residency restrictions.

READ MORE: Attorney Says Current Whereabouts Of Brian Laundrie, Gabby Petito's Fiancé, Are Unknown

Judge Eugene Pigott Jr. wrote that state law already prohibits offenders considered Level 3, or highest risk for new offenses, from any school grounds or a publicly accessible area or parked car within 1,000 feet while on parole or supervised release. That has been interpreted by courts as prohibiting them from living within 1,000 feet, he wrote.

“A local government’s police power is not absolute,” Pigott wrote. It has to yield to the state on matters like this where they’re inconsistent, he wrote.

“Local Law 4 and similar laws are easily passed and, understandably, receive local support, but, as the state has acknowledged, communities in recent years have taken to shifting the burden of sex offender housing to neighboring communities, thereby frustrating the state’s policy that each community bear the burden,” he wrote. Judges Susan Read, Jenny Rivera, Sheila Abdus-Salaam and Chief Judge Jonathan Lippman agreed.

The New York Civil Liberties Bureau, in a December court brief, said 109 cities, towns and villages and 21 counties statewide had such local laws.

The immediate case involved Nassau County’s Local Law 4 enacted in 2006 that prohibits registered sex offenders from residing within 1,000 feet of a school. A man who had been convicted in 2001 of possessing child pornography, after 22 months in prison and a year on parole, moved to an apartment within 500 feet of two schools. Michael Diack was charged with violating the local residency law.

READ MORE: Gabby Petito Search: Timeline Of Road Trip With Fiance Brian Laundrie, Notable Dates And Events

A trial judge dismissed the charge, saying the local law was pre-empted by the state law. A midlevel court reinstated the complaint. The Court of Appeals on Tuesday dismissed it again.

State law also prohibits sex offenders on probation or supervised release from entering school grounds, Pigott wrote. Designated a low-level offender and off probation, Diack wasn’t covered by the state restrictions but that doesn’t mean the state doesn’t have a comprehensive plan or delegated that authority in this to the county, Pigott wrote.

Attorney Kathy Manley, who represented Diack, said she and her associates have won similar cases in several individual counties, but this ruling applies to all of them. “There’s a lot of other people all over the state that are subjected to these laws and now they’re all invalid,” she said.

“Most of these people really don’t pose a risk,” Manley said. For higher-level offenders, the restrictions of supervised release can last up to 25 years. For those the state considers at the highest risk for reoffending, it imposes mandatory civil confinement in secure facilities, she said.

Nassau County Executive Ed Mangano said the law was designed to protect children. “Given the court’s decision, I urge the state Legislature to strengthen state law immediately,” he said.

MORE NEWS: September 17th Declared Nick Cordero Day In New York In Honor Of Broadway Actor Who Died From COVID

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)