Three convicted rapists awaiting release from state custody are suing Dayton, Minn., over an ordinance that virtually bans them from living in the city, arguing that the measure violates their constitutional rights and is trumped by state law.

The men are challenging a far-reaching 2016 ordinance that forbids convicted sex offenders from living within 2,000 feet of any school, day care, park, playground, public bus stop — even a pumpkin patch or apple orchard — within the city of Dayton, a rural community of about 5,000 residents northwest of the Twin Cities.

Because of the ordinance, the three argue, they remain unjustly confined at the Minnesota Sex Offender Program (MSOP) facility in St. Peter. More than a year ago, they were cleared for conditional release to a three-bedroom group home in Dayton, where they would have lived under 24-hour surveillance. The lawsuit was filed this month in Hennepin County District Court.

The suit is among the first legal challenges in Minnesota to local residency restrictions against sex offenders and could determine the fate of dozens of similar measures across the state. More than 80 localities have enacted such ordinances, amid a growing local backlash against the state’s efforts to return sex offenders to the community.

The restrictions have created a dilemma for the state agency that oversees the MSOP, which is under legal pressure to release more offenders but is running out of community facilities where it can send them. A total of 12 offenders who have been approved for conditional release remain stuck at the program’s treatment facilities as a large and growing swath of the state becomes off-limits to them.

“The current situation is untenable,” said Eric Janus, a professor at Mitchell Hamline School of Law and author of a book on sex offender laws. “These former offenders are entitled to be released, yet they continue to be held, by local actions that are subverting state law.”

Dayton’s mayor, Tim McNeil, said Tuesday that the city “intends to defend the ordinance to the extent that we can” but declined to comment further. In a response filed with the court Wednesday, the city said it has authority for land-use regulation and to promote public safety.

Deemed safe

The three offenders seeking to move to Dayton are older men with long and violent criminal histories. They include Ben Braylock, 86, who stabbed his wife to death in 1981 and, after serving prison time for the murder, raped two teenage girls; Demetrius A. Mathews, 54, who was sentenced to prison in 1983 for raping his 12-year-old niece, and later admitted to molesting a 3-year-old girl; and Marvin L. Breland, 60, who was convicted on three separate cases of forcing women into sexual acts while threatening them with weapons, according to court records.

Despite those histories, their lawyer argues, they have served their time and completed their required treatment. “These are individuals who have served their criminal sentences and that professionals have determined are safe to return to the community in a limited setting,” said Andrew Holly, a partner with the Minneapolis law firm Dorsey & Whitney LLP, which brought the suit.

The push to enact such ordinances has intensified since the summer of 2015, when U.S. District Judge Donovan Frank ruled that Minnesota’s sex offender program was unconstitutional and ordered sweeping changes. Although that ruling was overturned by a higher court, the state has been under pressure to show that it operates an effective treatment program and is not simply confining sex offenders indefinitely as punishment.

In response, local governments rushed to pass residency restrictions before offenders moved in. There are now 85 communities in Minnesota with such restrictions, up from about 50 less than two years ago, according to the Minnesota Department of Corrections. Two counties, Chisago and Le Sueur, have passed countywide residency restrictions.

Dayton’s ordinance, passed in October 2016, is unusually broad. It declares a long list of areas off-limits for convicted sex offenders, including athletic fields, ice skating rinks, bowling alleys, dance academies and public libraries.

Attorneys for the offenders argue that the ordinance is superseded by Minnesota’s sex offender law, which regulates how and when the state can return a civilly committed sex offender to a community. Under the law, offenders have a right to petition for release and state panels have the sole authority to approve or reject them, according to the suit.

“By restricting them from living in the normal world,’’ Holly said, the city of Dayton “is making it impossible to follow court orders and the appropriate state rules and regulations.”

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

In a widely cited study, research director Grant Duwe at the state Department of Corrections analyzed the case histories of 224 sex offenders who were reincarcerated for a sex crime before 2006. He found that none of their offenses 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 residential restriction laws, he found.

“There is absolutely no public safety benefit to residency restrictions — none at all,” Duwe said.