Supporters of a ban on gay conversion therapy say new laws outlawing the controversial practice in NSW will "save countless lives".
The state early on Friday joined Queensland and Victoria in banning the practice after a bill outlawing the so-called therapy passed parliament's upper house following an all-night sitting.
The laws, opposed by some religious groups, criminalise gay-conversion practices with a penalty of up to five years in jail.
The Opposition failed in a last-minute push to expand a parental exemption to cover grandparents, siblings and spouses, with the laws passing without amendments.
Independent MP Alex Greenwich, a driving force behind the laws, said he was grateful to the government for delivering a ban on the contentious therapy.
“LGBTQ people are loved and beautiful, and futile attempts to change or suppress who we are will now be illegal in NSW,” Mr Greenwich said in a statement.
Greens MP Cate Faehrmann said the ending of the "archaic and cruel practice" of conversion therapy was a historic moment.
"It was worth one hell of a late night to be one step closer to full equality," she posted on social media platform X.
LGBTQI advocacy group Equality Australia also welcomed the passage of the legislation as a historic step for the community in NSW.
“This law will save countless people from a lifetime of pain and in some cases save lives," the group's chief executive Anna Brown said in a statement.
“It sends a powerful message that we are whole and valid, just as we are.”
Under the laws, religious leaders will still be able to tell a group that their faith believes being homosexual or queer is wrong, but directing any acts to change a person's sexuality or gender identity could result in arrest.
There are also exemptions for seeking spiritual guidance, the teachings of a religious leader or expression of a religious belief through sermon.
“The new law does not intend to ban the teachings of a religious leader or expression of a religious belief through sermon," Attorney-General Michael Daley said in a statement.
Conversations between parents and children, siblings, and wider family and friends also fell outside the laws, the government said.
Faith communities have been broadly supportive of the changes, although Christian Schools Australia has aired concerns about the civil scheme leading to activist litigation against religious beliefs.