PORTLAND, Maine — Maine became the 17th state in the nation to pass a law banning conversion therapy of minors on Wednesday.

Governor Janet Mills signed the bill into law surrounded by supporters of the bill.

The law prevents people from engaging in any practice that attempts to change a minor's sexuality or identity. It also prevents a wide variety of counselors and medical professionals from advertising, offering, or administering any conversion therapy to people under 18.

RELATED: Maine becomes the 17th state to ban conversion therapy

RELATED: Lawmakers continue push for conversion therapy ban in Maine

"It's a harmful, widely discredited practice that only attempt to make LBGTQ youth feel ashamed of who they are," said Governor Mills.

Opponents of the law agree that any type of torture is unacceptable, and say that there have been no reported practices of conversion therapy, but believe that the law is overreaching.

They also believe the bill is a violation of parental rights and religious freedom.

RELATED: Lawmakers to try again to ban 'conversion therapy' in Maine

RELATED: Maine House passes bill to ban conversion therapy for minors

"We were not advocating change those kids, we were saying, 'you're taking a resource away from them,'" said Mike McClellan, the policy director for the Maine Christian Civic League. "Many people that age are confused. Maybe they go to church, they believe in the Lord, and they just don't feel good about where they're at, and they're asking for help."

Randy Cathcart knew that feeling. He came out in high school, but growing up in a religious setting in Missouri, he was taught that the only way God would love him is if he was straight.

"It was my deepest struggle and shame," said Cathcart. "I was so committed to being straight that I did anything I could to try to make that happen."

Cathcart tried conversion therapy, married a woman, and had kids, but ultimately knew that he was gay.

"It taught me not to trust myself and my experience," said Cathcart. 

He said he loved his wife, but ultimately their relationship lacked the romance that many couples wish to share.

"I started to recognize that the impact on my family was devastating. As I was trying to do what I believe is right."

He and his wife separated, but are still friends, and he feels more comfortable now, engaged to his partner and are set to be married this summer.

"When I started to live at peace with who I was, then I started to find peace in all sorts of ways in my life," said Cathcart.

The law will go into effect 90 days after the Legislature adjourns.