BUDAPEST — The largest broadcasters in Hungary criticized a new law banning the “display and promotion of homosexuality” among under-18s as a threat to freedom of expression, and one said it could impact showings of some Harry Potter films and classic TV shows.

Prime Minister Viktor Orban’s nationalist government pushed the law through parliament on Tuesday despite criticism from rights groups and the European Union, which said it could result in a loss of development funds for Hungary.

Mr. Orban and his ruling Fidesz party, which faces a tight election race next April, have increasingly railed against LGBT+ people and immigrants as part of their self-styled illiberal regime, which has deeply divided Hungarians.

German media giant RTL’s Hungarian unit, the country’s top broadcaster by audience, issued a statement saying it “condemned homophobia… We worry that the bill gravely harms freedom of expression, human rights and basic freedoms.”

Other major broadcasters including HBO, SPI International, and A+E Networks joined RTL’s statement. An RTL spokesman said it would come up later with a strategy to deal with the new legislation.

The law says it aims to “defend the right of children to an identity that conforms to their birth gender,” and bans content for minors that “promotes or depicts gender change and homosexuality.” The same rules apply for advertisements.

RTL said Hungary’s new law could provide grounds for banning family favorites from prime-time TV because they touch on homosexuality in some manner. “Based on this, works like Billy Elliott, Philadelphia, Bridget Jones’ Diary, or even some Harry Potter films would only be shown late at night,” RTL said. “Series like Modern Family would be banned, as would some episodes of Friends.”

The law will cause significant harm to the media business and makes it more difficult for all Hungarians to access certain kinds of content, the broadcaster added.

The government and the Fidesz deputy who submitted the bill did not reply to Reuters’ requests for comment on the possible impact of the law on programming. — Reuters