HARRISBURG, Pa. (AP) — Pennsylvania’s GOP-controlled Senate approved legislation Wednesday that Republicans say will restrict sexually explicit content and classroom instruction on sexual orientation and gender identity in public schools, mirroring partisan fights playing out in statehouses around the country.

The bills passed nearly along party lines, and Democrats warned that Gov. Tom Wolf will veto them. They still require approval from the state House of Representatives.

One bill, which passed 29-21, would prohibit classroom instruction on gender identity and sexual orientation for pre-kindergarten through fifth-grade students.

A second bill, which passed 30-20, would require educators to identify sexually explicit content in the curriculum, classroom materials and books. Educators would have to notify parents if a child’s coursework or a book they’d like to check out from a library contains explicit content, and parents could opt their children out of viewing the material.

Wolf’s office said he would veto “any legislation that discriminates against LGBTQIA+ Pennsylvanians.”

A third bill that would prohibit transgender girls and women from playing in youth and collegiate sports in a way that matches their gender was headed for a veto by the Democratic governor after passing the Senate on Wednesday.

Bills like the one on classroom instruction on gender identity and sexual orientation have cropped up in numerous states in recent months.

Florida drew national attention with a new law that prohibits educators from discussing sexual orientation or gender identity in primary grade levels or in a manner that isn’t age-appropriate or developmentally appropriate for students.

In May, North Carolina Senate Republicans rolled out a comparable proposal, couching it similarly as Pennsylvania Republicans: as legislation that gives parents control over what their children are being taught.

The Republican sponsors of the bill in Pennsylvania say it aligns with the state’s “timeline for when the existing academic standards on general sex education begins in sixth grade.”

Democrats slammed the bills during contentious floor debate as further harming an already marginalized population of LGBTQ students in schools.

“This is not Florida’s ‘Don’t Say Gay’ bill,” Sen. Lindsey Williams, D-Allegheny, said during debate. “It is worse.”

Under the legislation, schools must notify parents about any changes to a student’s services and monitoring, unless it can be “reasonably demonstrated” that notifying parents would “result in abuse or abandonment of a minor.”

With parent or guardian permission, school personnel can provide support to a student who has “initiated communication” with educators about sexual orientation or gender identity.

The bill would also allow parents to sue school districts for violation of the law.

One sponsor, Sen. Ryan Aument, R-Lancaster, said the bill empowers parents to initiate conversations of a sensitive nature, rather than teachers.

Another sponsor, Sen. Scott Martin, R-Lancaster, said parents should be involved when children are faced with difficult issues.

“Our parents want to be involved, they deserve to be notified and anything else isn’t acceptable,” Martin said.

Wolf’s LGBTQ Affairs Commission has criticized the legislation as a “cruel attempt to politicize LGBTQ people and deny their humanity in order to score cheap political points.”

Opponents attacked the bill on sexually explicit content in curriculum, classroom materials and books as a “book ban,” saying it was an attack on LGBTQ people.

Aument insisted the bill is not a book ban, asserting that explicit material is in schools all over the state.

“The more I speak about this proposal, the more I hear from families who provide additional examples,” Aument said during debate.

Amid criticism that the bill is an attack on LGBTQ people, senators had earlier amended the bill to remove a reference to an obscenity law in Pennsylvania that prohibits the exposure of minors to materials that include “homosexuality.”

Despite that, Democrats attacked the bill as homophobic and transphobic.

“Make no mistake, despite repeated denials, homophobia and transphobia are at the heart of this legislation, and a targeted attack on LGBTQ-centered books and an attempt to erase LGBTQ people will occur if this happens,” Sen. Maria Collett, D-Montgomery, said.