The senate of the US state of Florida on Tuesday passed a controversial bill banning lessons on sexual orientation and gender identity in elementary schools, a step that critics complain will hurt the LGBTQ community.

The legislation goes to Governor Ron DeSantis, who says he supports it, now that it has passed both chambers of the state legislature.

Opposition Democrats and LGBTQ rights activists have lobbied against what they call the “Don’t Say Gay” law, which will affect kids in kindergarten through third grade, when they are eight or nine years old.

The bill also bans teaching about sexual orientation and gender identity “in a manner that is not age-appropriate or developmentally appropriate for students in accordance with state standards.”

Critics say this wording means the bill could be applied to older children as well.

Republicans counter that teachers and students can in fact speak spontaneously about sexual orientation and gender identity and that the bill simply bans lessons on these issues from being part of official school curricula.

US Education Secretary Miguel Cardona criticized the bill on Tuesday, saying on Twitter: “Leaders in Florida have decided that bills based on hate & discrimination take priority over our students’ pandemic recovery.”

The advocacy group Equality Florida charged that state lawmakers have “locked arms with the angry mobs hurling anti-LGBTQ slurs at those asking for nothing more than a safe place to go to school without having to hide who they are.”

Ahead of the vote in the Senate, hundreds of students protested outside the state legislature building in the capital city Tallahassee.

For months, Republicans in Florida have been waging what they call a battle for parents to have a greater say over what their children learn in school.

“We are going to make sure parents are able to send their kid to kindergarten without having some of this stuff injected into some of their school curriculum,” DeSantis said Monday at a news conference.

The Republican governor is seen as a possible presidential contender for his party in 2024 -- possibly challenging Donald Trump if he decides to runs again.

The education war in Florida also centers on teaching of critical race theory, the doctrine holding that racism is an inherent part of law and legal institutions in America in that they serve to maintain social, economic and political inequality.

Last month, the lower house of the Florida legislature passed a bill banning the teaching of race-oriented subjects as part of official school curricula.