Nearly two years ago, the New York City Council celebrated when it passed a far-reaching ban on conversion therapy, a discredited practice to change a person’s sexual orientation or gender identity.

On Thursday, Corey Johnson, the council speaker, who is gay, said the council would act swiftly to repeal the ban.

The move is a gambit designed to neutralise a federal lawsuit filed against the city by a conservative Christian legal organisation; if the case were to be heard by the Supreme Court, advocates for the LGBT+ community fear that the panel could issue a ruling that could severely damage attempts to ban or curtail conversion therapy.

This is not the first time New York City officials have sought to change a regulation to avoid a Supreme Court challenge. In July, the Police Department amended a regulation that had limited residents from transporting guns outside their homes, after the Supreme Court had agreed to hear a case challenging the city rule.

Supporters of repealing the conversion therapy ban said that it is a regrettable but necessary step given the Supreme Court’s conservative makeup under the Trump administration.

Thousands march against Donald Trump in LGBT rights parade Show all 8 1 /8 Thousands march against Donald Trump in LGBT rights parade Thousands march against Donald Trump in LGBT rights parade A marcher hold a sign that reads "Love is Love is Love" on the National Mall with the Washington Monument in the background during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers unfurl a huge rainbow flag as they prepare to march in the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers gather to hear speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade Gil Mendez, of San Francisco, holds a sign to honor the victims of the shooting at the Pulse Nightclub in Orlando as he marches during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade An demonstrator looks on as LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher listens to speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher mugs for the camera during the Los Angeles LGBTQ #ResistMarch AP

“Obviously I didn’t want to repeal this. I don’t want to be someone who is giving in to these right-wing groups,” Mr Johnson said in an interview. “But the Supreme Court has become conservative; the 2nd Circuit, which oversees New York, has become more conservative.”

Mr Johnson introduced a bill Thursday to repeal the ban; once the full council approves the measure and Mayor Bill de Blasio signs it, the city would then be governed by a less restrictive state law, which applies only to minors.

A vote could come by the end of the month, after a hearing, council officials said.

“We think this is the most responsible, prudent course,” Mr Johnson said.

The city’s law, passed in December 2017, was sponsored by Melissa Mark-Viverito, then the council speaker. It prohibited consumers from being charged “for services intended to change a person’s sexual orientation or gender identity,” and created a $1,000 fine for each violation.

In January, the Alliance Defending Freedom, an Arizona-based group, filed a lawsuit challenging the law on the grounds that it violated free speech, suggesting that the measure was “the first in the nation to censor speech” between counsellors and adult patients.

“This law was a textbook violation of free speech and the right of individuals to pursue the lives and identities they want to exercise,” said Roger Brooks, a senior lawyer for the group, which says its mission is to defend religious freedom.

“We went in with confidence that the courts would agree with us,” he said. “This move by the city suggests that on mature consideration, they think that would be the outcome as well.”

Medical professional organisations have long denounced the practice of conversion therapy. The American Psychological Association found in a 2009 report that the practice does not work and that “individuals experienced harm” from the therapy. The therapy is also predicated on the false notion that LGBT+ sexual orientation is a mental disorder.

Crowd erupts as Straight Pride Parade leader says 'We're a totally peaceful racist group'

Individuals who are “distressed by their sexual orientation” said that they benefit “when offered interventions that emphasise acceptance, support and recognition of important values and concerns,” according to the report.

Eighteen states, the District of Columbia and more than 50 municipalities have passed conversion therapy bans for minors, according to the National Center for Lesbian Rights. That still has not stopped the therapy from happening.

The Williams Institute at the UCLA School of Law estimates that almost 700,000 LGBT+ adults aged 18-59 have received conversion therapy, including 359,000 who received the therapy as adolescents.

“I’m heartened that the City Council pulled back a statute that could undermine efforts nationally to end conversion therapy because it might be viewed as overly broad,” said state Sen. Brad Hoylman, D-Manhattan and the state’s only openly gay senator. He sponsored the state law that would govern the city in the absence of a city-specific ban; it bars mental health professionals from seeking to shift the sexual orientation or gender identity of minors.

“The legal climate is less favourable at the federal level for the LGBTQ community,” he added. “We crafted the law specifically to pass a legal challenge because we knew this was an area that anti-LGBT legal forces were exploring.”

New York City’s law was viewed as being vulnerable to a challenge because it was much broader than similar statutes.

The city and state’s consumer fraud laws will still allow adults who feel duped by the therapy to seek recompense, said Shannon Minter, legal director for the National Center for Lesbian Rights.

“Now that the state has passed its law, the New York City law does not create any new rights that don’t exist. Having to defend that lawsuit is a completely unnecessary distraction,” Mr Minter said. “We know there is relentless hostility against protecting LGBT people.”

The current political environment means that activists must be more strategic, Mr Minter added. “You could trim a law back and avoid some vulnerability,” he said. “We are being pushed to a whole new level of intelligent strategy.”

Independent Minds Events: get involved in the news agenda

Brooks said that Alliance Defending Freedom has not decided whether to contest New York’s efforts to repeal its law or challenge the New York state law. Similar conversion therapy bans for minors are being challenged in Maryland and Florida, but have already withstood challenges in California, the first state in the country to pass an anti-conversion law, and in New Jersey, Mr Minter said.

“Conversion therapy is the ultimate form of rejection and the cause of many suicides among the LGBTQ community,” said Mathew Shurka, founder and strategist of Born Perfect, a group seeking to outlaw conversion therapy.

Shurka, 31, who is gay, underwent conversion therapy for five years, starting as a teenager growing up in New York City. He said his main goal is to protect others, specifically young people, from experiencing what he did.

Ms Mark-Viverito, who is running for Congress, also endorsed the measure to kill her own legislation.

“I was very proud at the time, because we were doing something out of the box and we were aggressive,” Ms Mark-Viverito said. “But understanding the climate we are in today, I’m not interested in putting anyone’s rights in jeopardy or weakening our power as a city.”