The Republican governor of Arizona quickly signed a bill Thursday repealing a 1991 Arizona law that had barred HIV and AIDS instruction in public schools because it could promote a homosexual lifestyle.
The move was intended to end a discrimination lawsuit filed by LGBTQ groups.
The signing by Gov. Doug Ducey came less than an hour after the state Senate approved the repeal with a 19-10 vote.
One of the 10 Republicans who opposed the measure said she was against sex education. Another noted that gay men are most at risk from the HIV virus.
The repeal received overwhelming support in the state House on Wednesday.
The House action came a day after Republican Attorney General Mark Brnovich declined to join the defense of the LGBTQ suit filed last month against the state Board of Education and schools chief.
The 1991 law prohibited HIV and AIDS instruction that "portrays homosexuality as a positive alternative lifestyle" or "suggests that some methods of sex are safe methods of homosexual sex."
The lawsuit says the law stigmatizes lesbian, gay, bisexual and transgender students.
Lambda Legal filed the lawsuit along with the National Center for Lesbian Rights in U.S. District Court in Tucson.
Shannon Minter, legal director for the National Center for Lesbian Rights, said Wednesday that repealing the law would end the lawsuit.
Republican state Rep. T.J. Shope sponsored the repeal language, which emerged Wednesday and was tacked onto another education-related bill.
He called the old law "antiquated" but said Republicans who hold majorities in both chambers of the Legislature were split, with some critical of Brnovich's decision against defending against the lawsuit and others believing the law was outdated.
Gay legislators celebrated the repeal in emotional, sometimes deeply personal speeches in the House. Rep. Andres Cano, a gay Democrat from Tucson, said stigmatizing gay children leads to shame, bullying, assaults and suicides.
"Our schools should be safe, they should be inclusive, they should be free from harassment, bullying and stigmatization," Cano said.
Ducey sent a tweet Thursday praising Shope for his leadership "on this common sense solution, and for getting it done in a bipartisan manner."
Arizona was one of seven states with laws intended to prohibit promotion of homosexuality.