California has become the first state in America to ban controversial therapy which aims to reverse homosexuality in children.
Governor Jerry Brown signed a bill on Sunday which prohibited people under the age of 18 from undergoing sexual orientation change therapy.
The move marks a major victory for gay rights advocates who say the therapy, also called reparative therapy, has no medical basis because homosexuality is not a disorder.
The bill had support from the American Psychiatric Association, California Psychological Association and the California Board of Behavioral Sciences, among others.
Human Rights Campaign President Chad Griffin said: "LGBT (lesbian, gay, bisexual and transgender) youth will now be protected from a practice that has not only been debunked as junk science, but has been proven to have drastically negative effects on their well-being."
He urged other states to follow California's lead.
State Senator Ted Lieu, the bill's sponsor, said in a statement that Mr Brown had signed the bill.
Mr Lieu said the psychiatrist who pioneered the therapy, Dr Robert Spitzer, has since renounced it and has apologised to the gay and lesbian community.
Opponents said the bill encroached on the rights of parents to make choices for their children. They also said politicians should not regulate what they considered to be a matter for medical boards to decide.
The bill will come into effect on January 1.