A New York City Council member on Thursday proposed repealing the city’s ban on conversion therapy to thwart a potential Supreme Court battle that could set precedent that would complicate efforts to outlaw the discredited practice.

Council Speaker Corey Johnson’s bill comes in response to a legal challenge from the Alliance Defending Freedom, a conservative Christian organization that alleges that the ban infringes upon freedom of speech and religion. The federal lawsuit, filed in January, targets the city’s ordinance prohibiting people from charging others for conversion therapy, which includes any technique meant to change a person’s sexual orientation or gender identity.

The decision to suggest eradicating the ban was “painful,” Johnson said in a statement. The council and Mayor Bill de Blasio (D), a 2020 presidential hopeful, are expected to support the repeal, which would take effect by October.

“After intense deliberation, the Council concluded that it was best to take this drastic step,” said Johnson, who is gay. “The courts have changed considerably over the last few years, and we cannot count on them to rule in favor of much-needed protections for the LGBTQ community.”

The move to repeal the ban is the first time Born Perfect, a legal campaign that works to end conversion therapy, has advocated undoing a prohibition to protect its strategy of pushing for local and state restrictions. Eighteen states, the District of Columbia and about 55 municipalities ban conversion therapy for juveniles.

The Alliance Defending Freedom has a history of elevating cases to the Supreme Court, where a conservative-leaning majority currently sits. The U.S. Court of Appeals for the 2nd Circuit, which includes New York, also has become more conservative since President Trump appointed three judges to it. Two other of his nominees for the 2nd Circuit are pending.

Roger Brooks, senior counsel for the Alliance Defending Freedom, called New York City’s plan to repeal the conversion therapy ban a “win” for the Orthodox Jewish psychotherapist behind the lawsuit, his clients and all New Yorkers.

“By trying to regulate and censor private sessions between an adult and his counselor, New York City directly violated freedom of speech — a core right protected by the First Amendment,” Brooks said in a statement. “The city council appears to have realized its error and correctly concluded that this censorship is unconstitutional.”

The ordinance, which imposes a $1,000 fine for a first offense, was susceptible to legal challenges because it is broader than other similar legislation. Most conversion therapy laws, including a New York state law that took effect in January, ban the practice just for juveniles.

Johnson told The Washington Post that he initially turned down LGBTQ rights organizations’ efforts to persuade him to reverse the ban because he wanted to resist giving in to right-wing groups. Eventually, he said, he listened to the advocates who urged him to propose the repeal for the sake of protecting other laws.

“It was a process for me,” Johnson told The Post. “And ultimately, when the case was made to me that this law could potentially be jeopardizing protecting millions of other children across the country, that was the thing that moved me.”

Advocates believe LGBTQ New Yorkers’ rights will remain unchanged after the repeal because the city ordinance duplicates the state’s consumer-protection laws, said Mathew Shurka, a co-founder and strategist at Born Perfect. The organization previously achieved a victory in New Jersey and a settlement in California for people who used state consumer-fraud laws to sue over their experiences with conversion therapy.

Four lawsuits across the country currently challenge conversion therapy bans, Shurka said, and advocates want to minimize legal challenges. The consumer-protection angle of New York City’s existing ordinance is, legally, “a little bit of gray,” he said, making it good ground to cede.

“Instead of investing in winning the lawsuit or fighting for the lawsuit, why don’t we just repeal the law because it’s an unnecessary law?” Shurka said.

Nearly 700,000 adults in the United States have undergone conversion therapy, according to the Williams Institute at the University of California at Los Angeles School of Law. Tactics include talk therapy, “aversion treatments” such as electric shocks and non-aversive treatments such as trying to change thought patterns through hypnosis.

Conversion therapy is ineffective and associated with poor mental health, including suicidal ideation, according to many experts. Several major medical associations — including the American Medical Association and the American Academy of Pediatrics — oppose the practice. People who report wanting to change their sexual orientations perceive a benefit from therapeutic interventions when they are given acceptance, social support and opportunities to explore their identity, according to the American Psychological Association.

The conversion therapy industry was shaken several weeks ago when the founder of faith-based conversion therapy center Hope for Wholeness Network said he was gay and recognized the harm he had caused.

“It’s all in my past, but many, way TOO MANY continue believing that there is something wrong with themselves and wrong with people that choose to live their lives honestly and open as gay, lesbian, trans, etc.,” McKrae Game, 51, wrote on Facebook. “The very harmful cycle of self shame and condemnation has to stop.”

Read more: