A group of convicted sex offenders has filed a federal lawsuit challenging the constitutionality of a far-reaching ordinance in Apple Valley that severely restricts where they can live, alleging that the ordinance effectively bars them from living anywhere in the city and violates the Constitution’s ban on retroactive punishments.

In a federal class action lawsuit filed Wednesday, three sex offenders seek an injunction preventing the city of Apple Valley from enforcing the ordinance, which prohibits people convicted of certain sex offenses from living within 1,500 feet of schools, parks, playgrounds, churches and child-care centers. The ordinance, which the Apple Valley City Council approved in February 2017, is so extensive that more than 90% of the residential properties within the city’s boundaries are off-limits to offenders, the lawsuit states.

In recent years, cities and counties across Minnesota have rushed to approve sex-offender residency restrictions, in part over concerns that the state is running out of places to house offenders. Approximately 90 localities across Minnesota, from Inver Grove Heights to Cloquet, have adopted such ordinances with varying degrees of residency restrictions, according to the Minnesota Department of Corrections (DOC). The ordinances have effectively made large swaths of the state off-limits to many offenders who have already served their prison terms.

Yet such ordinances have come under increased scrutiny from the courts and attorneys representing sex offenders, who argue that the measures violate civil rights and also impede efforts by the state to integrate offenders back into society.

Attorneys for the three offenders argue that the Apple Valley ordinance violates the Constitution’s ex post facto clause, which prohibits the government from creating laws that retroactively increase punishment for crimes that have already been committed.

“The government cannot go back and change the consequences of a previously committed crime,” said Adele Nicholas, an attorney in Chicago who represents the offenders. “This law is so burdensome and makes it so difficult to find a place to live that it actually amounts to a punishment — and a punishment that was not in place at the time of our clients’ criminal cases.”

Apple Valley Mayor Mary Hamann-Roland and the city administrator, Tom Lawell, declined to comment on the lawsuit, saying the city had not been served with the complaint.

The three sex offenders are not identified by name in the lawsuit. They include a 32-year-old man from Bloomington who was found guilty as a juvenile for a criminal sexual assault against another minor. Last year, the man rented an apartment in Apple Valley because it was close to his work and near his family and friends. After moving into the apartment, however, the man went to register with the Apple Valley Police Department, where he was told that he would be arrested for violating the ordinance if he did not move out of the apartment. The man has since moved to Bloomington, the lawsuit says.

Another plaintiff in the case is a married 44-year-old father who bought a townhouse in Apple Valley after he was convicted of possession of child pornography. Soon after buying the home, the man was told by the Apple Valley Police Department that he was prohibited from living there because of the new ordinance, the complaint alleges. Another convicted offender alleges that he and his wife put their life savings into a down payment on a home, and then were told by the Apple Valley Police Department that he would be charged with violating the ordinance if he did not move out.

“Establishing a stable home for oneself and one’s family is something that everyone should be entitled to do,” Nicholas said.

In 2018, a Hennepin County judge struck down a sweeping residency restriction ordinance in the city of Dayton, Minn., a semirural town of about 5,000 northwest of the Twin Cities. The city’s measure barred convicted sex offenders from living within 2,000 feet of any school, church, day care provider, park, playground or public bus stop — even “a seasonal pumpkin patch or apple orchard” — within the city.

The ordinance was so specific that it even prohibited offenders from handing out candy on Halloween or leaving an exterior porch light on to invite trick-or-treaters.

In that case, the Hennepin County judge declared the ordinance void because it conflicted with a state law that establishes a legal process for reintegrating civilly committed sex offenders into society.

Criminal justice researchers have found that geographic residency restrictions are largely ineffective at preventing sex crimes, in part because those who reoffend tend to victimize people they know rather than pursue strangers living near them.

In one study, research director Grant Duwe at the state Department of Corrections analyzed the offense patterns of every sex offender released from Minnesota correctional facilities between 1990 and 2002 who was reincarcerated for a new sex offense. Of 224 sexual re-offenses in the analysis, Duwe found that not a single one would have been prevented by a residency law. Of the few offenders who contacted a juvenile victim near their homes, none did so near a school, park, playground or other location included in residency restriction laws, he found.

Dr. Michael Thompson, a forensic psychologist and spokesman for the Minnesota Association for the Treatment of Sexual Abusers (MnATSA), said residency restrictions may unintentionally make communities less safe by making it more difficult for sex offenders to find stable housing, which can render them homeless and make them more difficult to monitor. “Research has determined that a lack of stable, permanent housing increases the likelihood that sex offenders will reoffend and abscond from community-based correctional supervision,” he said. “Stability protects the community against sexual re-offense.”

There are 17,800 registered sex offenders in Minnesota, including about 730 offenders who have been court-ordered to receive treatment at the Minnesota Sex Offender Program (MSOP) after having completed their prison sentences.