DES MOINES, Iowa (AP) — Iowa can enforce a law that restricts teachers from talking about LGBTQ+ topics with students in kindergarten through the sixth grade and bans some books in libraries and classrooms, an appellate court said Monday.

The decision for now vacates a lower court judge’s temporary blocks on the law.

The measure was first approved by Republican majorities in the Iowa House and Senate and GOP Gov. Kim Reynolds in 2023, which they said reinforced age-appropriate education in kindergarten through 12th grades. It’s been a back-and-forth battle in the courts in the three years since lawsuits were filed by the Iowa State Education Association, major publishing houses and bestselling authors, as well as an LGBTQ+ advocacy organization, Iowa Safe Schools.

The law was in effect for part of the 2024-2025 school year until last March, when a federal judge reissued a temporary block on the book ban provision, which prohibits books containing specific sex acts from appearing in school libraries or classrooms. In a separate decision in May, U.S. District Judge Stephen Locher said Iowa could restrict mandatory instruction on gender identity and sexual orientation in schools up through the sixth grade but could not enforce the restriction on any “program” or “promotion,” saying those terms were too broad.