New Jersey's Supreme Court ruled on Thursday that towns cannot ban sex offenders from living near schools, parks, or other places where children gather.

The court struck down two municipal ordinances that restricted where convicted sex offenders could live, a ruling that invalidates similar laws in more than 100 other towns across the state.

The two cases, Cherry Hill and Galloway townships in southern New Jersey, highlighted Megan's Law, the landmark 1994 state legislation that requires convicted sex offenders to register their whereabouts with law enforcement.

The broader issue, though, centered on whether towns have the authority to pass ordinances that may conflict with state laws.

In its 6-0 decision, the Supreme Court echoed a 2008 appellate ruling that sided with the plaintiffs. Justice John E. Wallace Jr. did not participate.

"Cherry Hill Township's and Galloway Township's ordinances, establishing residency restrictions that formed buffer zones for convicted sex offenders living within their communities, are precluded by the present, stark language of Megan's Law," the justices wrote. "It is that language which controls."

All 50 states have some version of Megan's Law, but the cases decided Thursday are the first of their type to reach a state Supreme Court, said Frank Corrado, an attorney for the American Civil Liberties Union who represented the unidentified plaintiff in Galloway Township. The ACLU filed a lawsuit in Vermont this week challenging a similar ordinance in the town of Barre, near Montpelier.

"We continue to feel these laws are counterproductive and don't accomplish their purpose," Corrado said Thursday. "There's no real connection between limiting where someone can live and a sex offense occurring in a park or public place."

Attorneys representing Cherry Hill and Galloway townships argued before the Supreme Court in March that local ordinances fill gaps in Megan's Law and that towns should have the right to expand on state laws under New Jersey's home rule statute.

"I'm obviously very disappointed that the Supreme Court didn't recognize the home rule doctrine of our constitution, which permits towns to act on behalf of the health and safety of our residents," Demetrios Stratis, an attorney representing Galloway Township, said.

Stratis said supporters of the ordinances will now have to rely on the state Legislature to expand Megan's Law or explicitly authorize towns to craft their own rules.

Iowa's legislature recently revised a state law to relax restrictions on where lower-risk sex offenders can live, but also created buffer zones that prevent them from entering areas where children congregate.

Under Megan's Law, convicted sex offenders may only live in a residence approved by a parole officer, and must notify authorities when they change addresses and employment. The law forbids anyone from using an offender's criminal record to deny housing.

Both New Jersey towns have ordinances that prohibit sex offenders convicted of offenses against minors from living within 2,500 feet of schools, parks, playgrounds and day care centers. In all, about 120 towns in New Jersey have passes similar ordinances.

The Galloway Township case involved a Stockton College student who had served two years' probation for criminal sexual contact committed when he was 15 against a 13-year-old girl. He was designated under Megan's Law as a Tier I offender, meaning he was considered to have the lowest risk of re-offense.

The township sent him a notice telling him he could not live on campus since his dorm was within 2,500 feet of a day care center.

The two plaintiffs in the Cherry Hill case, James Barclay and Jeffrey Finguerra, moved into a motel within 2,500 feet of Camden Catholic High School while they awaited approval for a new residence from their parole officers. The township found them guilty of violating the ordinance and fined them.