Hungary's parliament on Tuesday passed legislation banning the "promotion" of homosexuality to minors in what critics have slammed as a crackdown on LGBTQI rights.

The legal amendments are the latest in a series of measures right-wing Prime Minister Viktor Orban's government says are aimed at fighting paedophilia and protecting children.

But critics claim the changes -- which effectively ban educational programmes and publicity of LGBTQI (lesbian, gay, bisexual, transgender, queer and intersex) groups -- would "severely restrict" freedom of expression and children's rights.

More than 5,000 people rallied outside parliament on Monday against the amendments, which LGBTQI groups have compared to similar legislation in Russia.

The legislation passed with 157 votes in favour and one vote against in the parliament controlled by Orban's Fidesz party.

The opposition boycotted the vote except for lawmakers from the nationalist Jobbik party who supported the changes.

"In order to ensure... the protection of children's rights, pornography and content that depicts sexuality for its own purposes or that promotes deviation from gender identity, gender reassignment and homosexuality shall not be made available to persons under the age of 18," the legal text said.

More than 5,000 people rallied outside parliament on Monday against the legislation
More than 5,000 people rallied outside parliament on Monday against the legislation AFP / GERGELY BESENYEI

Sexual education classes "should not be aimed at promoting gender segregation, gender reassignment or homosexuality", it said.

It was not clear what punishments could be meted out for those seen as breaking the new legislation.

In Washington, where President Joe Biden has made LGBTQI rights a top priority, State Department spokeswoman Jalina Porter said the new law "raises concerns" about "freedom of expression" and included restrictions that "have no place in democratic society".

The director of Amnesty International Hungary, David Vig, said that the law "will expose people already facing a hostile environment to even greater discrimination".

He urged other EU member states to raise the issue with Hungary urgently to ensure "that the EU is a safe place for LGBTI people".

There has already been reaction from elsewhere in the EU, with France's European Affairs Minister Clement Beaune saying his government would follow the issue closely and that "we cannot let our fellow citizens think that on fundamental subjects Europe is 'a la carte'".

The EU's central tenets should be defended "without weakness," he told reporters during a visit to Vienna.

The law could mean that movies seen as promoting homosexuality can only be shown at night
The law could mean that movies seen as promoting homosexuality can only be shown at night AFP / GERGELY BESENYEI

French Green MEP Gwendoline Delbos-Corfield, a European Parliament rapporteur on Hungary, called the law an "affront to European values" and an "attempt to use child protection as an excuse to attack LGBTQI rights".

She also urged other EU states to challenge Hungary at hearings scheduled later this month.

The legislation could mean that movies that some see as promoting homosexuality, such as "Bridget Jones's Diary", "Harry Potter" or "Billy Elliot", can only be shown at night with an 18-plus classification, broadcaster RTL Klub Hungary said.

Attila Kelemen was among thousands who protested against the amendments on Monday, saying it was getting "more and more uncomfortable" to live in Hungary "not only for gays, but practically also for everybody".

"To mix up homosexuality with sexual crimes is disgusting," the school psychologist, 23, told AFP.

"The text of the law is very ambiguous and that is on purpose. We do not know the full consequences yet," Zsolt Szekeres of rights group Hungarian Helsinki Committee told AFP.

"Even if it does not mean that a Gay Pride would be banned, it has a chilling effect on organisers... because they would be scared of the consequences and it gives an excuse to the police to initiate proceedings."

Advertising by companies such as Coca-Cola, which campaigned for gay acceptance in Hungary in 2019, could be banned, as could books dramatising homosexuality.

In recent years, Orban, who has ruled Hungary since 2010, has enacted a socially conservative policy agenda, shaping the EU member into what he calls a bastion against liberal ideologies.

Last December, parliament adopted a package of measures enshrining what the government sees as the traditional family, effectively banning adoption by same-sex couples.

In May 2020, a ban on legally changing one's gender came into force, with rights groups warning this would expose transgender Hungarians to discrimination.

In 2018 a government decree effectively banned universities from teaching courses on gender studies.