SALT LAKE CITY — A lawsuit over restrictions on talk about homosexuality in Utah classrooms has been settled after the state changed the law in a case that sets the stage for challenges to similar measures in other states, LGBT-rights groups said Friday.

Attorneys said the rules banning "advocacy of homosexuality" created a culture of silence for LGBT students, making them feel like they weren't worthy of respect or discussion.

"This is going to make the climate in Utah schools so much better," National Center for Lesbian Rights attorney Christopher Stoll said.

The Utah Attorney General's Office said state attorneys were pleased to work with the group Equality Utah and settle the case in a way that makes sure Utah public-school students aren't discriminated against, said spokesman Dan Burton in a statement.

Several other states still have similar measures on the books, including Arizona, Alabama, Mississippi, Louisiana, South Carolina and Texas, Stoll said.

The Utah law passed in 2001 was originally aimed at sex-education classes, but it had also been cited in other cases, like when a book about lesbian mothers was pulled from a school-library shelf in 2013.

The plaintiffs also said the rules blocked teachers from protecting a 7-year-old boy from bullies who beat him and burned him on a hot slide because he sometimes wore girls' clothes. The boy's mother was told school staff couldn't tell other kids it was OK to be gay or wear girl's clothes, according to the lawsuit filed last fall.

The settlement includes a safety plan for that child and policy changes at Weber County schools, as well as unspecified cash compensation, Stoll said.

Lawmakers voted in March to change the law to ban "advocacy of premarital or extramarital sexual activity," rather than homosexuality. Republican leaders in the conservative state said the change lets LGBT students know they are welcome while still making it clear teachers should not promote sex outside marriage.

The legal settlement was finalized after the Utah State Board of Education also changed its policies.

Clifford Rosky with Equality Utah, which was also a plaintiff, said in a statement those changes make it clear "every student in Utah public schools is entitled to an education free from all manner of bullying or discrimination."

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.