Similar legislation has been enacted in California and New Jersey. Earlier this year, President Barack Obama conveyed his support for such bans.

"These so-called therapies treat homosexuality as a disease," state Sen. Daniel Biss, D-Evanston, said in a statement after Rauner signed the bill, which Biss sponsored with state Rep. Kelly Cassidy, a Chicago Democrat. "They're out of date and can be deeply destructive to youth. Outlawing these practices is a small step in our pursuit for LGBT rights , but it's an extremely important step in protecting young people in Illinois."

Under the new law, those under 18 years old can get counseling to discuss concerns or thoughts about their sexuality, but professionals licensed by the state may not try to change the minor's orientation.

Illinois Gov. Bruce Rauner on Thursday signed legislation barring therapists from trying to change a young person's sexuality.

Cathie Adams, a former chairwoman of the Texas GOP, advocates ‘reparative’ therapy for minors

Backers of the measure were unsure how Rauner, a first-term Republican who has kept his stance on several social issues private, would act. He has refused to discuss his views on same-sex marriage.

After announcing the bill's signing, his spokeswoman Catherine Kelly said Rauner has no social agenda and believes the measure protects children's interests.

"The administration carefully reviewed this legislation to ensure it would not prohibit or otherwise interfere with religious freedom or family access to religious counseling," she said in a statement.

Cassidy said Rauner met with a survivor of such therapy and appeared moved by what he heard.

The measure also adds the therapy to the Illinois Consumer Fraud Act, giving people more ability to take legal action. Cassidy said that provision makes Illinois' ban stronger than other states.

Supporters of the measure argue that “conversion therapy” has been discredited and can be harmful to young people. But opponents question whether therapists would be punished unfairly and say a ban limits parents' treatment decisions.

The Associated Press