The government now says it will ban so-called conversion therapy for gay or bisexual people in England and Wales - but not for transgender people.
It comes hours after it had said it would drop plans for the ban entirely.
The announcement on Thursday evening that ministers would explore non-legislative routes to stop the practice was criticised by LGBT groups and MPs.
According to NHS England, conversion therapy tries to change someone's sexual orientation or gender identity.
NHS England and other major psychological bodies in the UK have warned all forms of conversion therapy are "unethical and potentially harmful".
A senior government source has told the BBC the ban will feature in the next Queen's Speech.
The legislation will mean therapy to attempt to change people's sexuality will be outlawed, but those practices carried out to try to change people's gender identity will not.
Just hours earlier, a government spokesperson had said the ban would be dropped and they would instead review ways to stop conversion therapy practices through existing law and other measures.
But the announcement that the ban will not cover gender identity has been met with criticism from some MPs and charities.
The Rainbow Project, said any ban that did not include transgender people was "not a real ban". Labour MP Nadia Whittome said it was "still not good enough", before adding: "LGB comes with the T, and the Tories are not on our side".
Speaking to BBC Radio 5 Live, Jayne Ozanne, a conversion therapy survivor and chair of the #BanConversionTherapy coalition, accused Boris Johnson of throwing LGBT people under a bus, adding it was "utterly ludicrous" that transgender people were not included in the ban.
Some gender critical groups had fought for the ban not to include conversion therapy experienced by transgender people.
And Nikki da Costa, a former director of legislative affairs at No 10, said elements of the legislation, particularly relating to gender identity for under 18s and talking therapy, would have had "profound consequences for children struggling with gender dysphoria".
She told BBC Radio 4's Today programme on Friday: "Doctors, therapists and parents would be deterred from exploring with a child any feelings of what else may be going on for fear of being told they're trying to change a child's identity", adding that it was "deeply concerning".
It is thought that the government sees it as too complicated to avoid any unintended consequences of the legislation - which may affect parents, teachers, and therapists who are helping children experiencing gender identity issues.
But the Welsh Government called the move "unacceptable" and said it was getting legal advice on action it could take to ban trans conversion therapy.
Jane Fae, who chairs Trans Media Watch, told the BBC that she was "gutted, not surprised and very very worried about the community".
She said that conversion therapy was widely used within the transgender community.
But Ms Fae added: "It's not about therapy, it is not even about talking, it is about mistreatment, abuse and in some cases torture".
The initial announcement that ministers planned to shelve a ban was criticised, with the LGBT charity Stonewall calling the news "devastating".
LGBT+ Conservatives, which is affiliated to the party, said it was "shocked and disappointed" and that they would write to the prime minister.
Simon Calvert, deputy director at The Christian Institute, said it was "disappointing" that after the government made the "sensible" initial conclusion to drop the ban, it had now "caved in to people who see this law as a way of punishing evangelicals for their beliefs about sexuality".
He had earlier welcomed the news the ban would be dropped, arguing it could breach the European Convention on Human Rights and impinge on religious rights.
Some groups, including the Evangelical Alliance, which says it represents 3,500 churches, say a ban on conversion therapy could restrict religious freedoms. However, many other religious leaders support a ban.
Any policy relating to transgender peoples' lives is always the subject of fierce public and political debate, so the chances that a second U-turn will quieten things down are slim.
The government's national LGBT survey in 2017 found transgender people were twice as likely to have been offered conversion therapy than their gay and bisexual counterparts.
More than 108,000 people responded to the consultation, which led Theresa May's government to announce plans to ban conversion therapy in 2018.
The promise was brought forward by Boris Johnson. In July 2020, he said the practice was "absolutely abhorrent" and "[had] no place in this country".
In May 2021, the Queen's Speech reiterated that measures would be "brought forward" to ban it.
Liz Truss, in her role as minister for women and equalities, said after the Queen's Speech: "As a global leader on LGBT rights, this government has always been committed to stamping out the practice of conversion therapy."
But she also stated that the ban would only happen following a consultation seeking "further views from the public and key stakeholders".