The European Union's top court has ruled that Hungarian anti-LGBTQ laws violate EU rules and infringe its values of equality and minority rights.

The laws were brought in by Viktor Orbán's government in 2021 and banned so-called promotion of homosexuality or gender change to under-18s, arguing it violated child protection laws.

The European Court of Justice ruled that the Orbán reforms breached EU rules on a number of levels, and significantly that it also broke the founding values of Article 2 of the EU Treaty - an unprecedented finding.

The ruling comes nine days after Hungarians voted to end Orbán's 16-year era of continuous rule.

The ECJ ruled that the Hungarian law interfered with rights such as a ban on discrimination based on sex and sexual orientation, respect for private and family life, and freedom of expression and information.

The law also stigmatised and marginalised people who were transgender or not heterosexual and associated them with people convicted of paedophilia, the court found.

The Hungarian law was contrary to the very identity of the Union as a common legal order in a society in which pluralism prevails, it ruled.

John Morijn, professor of law and politics in international relations at the University of Groningen in the Netherlands, said the Court's ruling was historic in its symbolism, meaning that the rights of a group in society could not be negotiated away.

Orbán's Fidesz party was able to push through the legislation with the help of a supermajority - with control of two-thirds of parliament.

Last year, it passed a further amendment that enabled a ban on public events involving the LGBTQ community, such as Budapest's popular Pride march, which went ahead despite the ban, prompting prosecutors to file charges against Mayor Gergely Karácsony.

The European Commission indicated that the anti-LGBTQ law would be one of the issues it would raise with the new government.

It's up to the... Hungarian government to abide by the ruling and once that is done the issue is solved, said spokeswoman Paula Pinho.

However, the new Prime Minister Péter Magyar has not significantly addressed the laws related to Hungary's LGBTQ community, although he expressed a vision for Hungary as a place where people can think and love differently.

Magyar has promised a more pro-European approach to Hungary’s relations with the EU, including reversing the controversial legislation. His Tisza party holds a two-thirds majority in parliament.

Katja Štefanec Gärtner of LGBTQ rights group Ilga-Europe emphasized that there is now no excuse for the European Commission not to push Hungary to repeal its law quickly.

The ruling could have broader legal implications within the EU, as it reinforces the notion that member states cannot violate the foundational principles of pluralism and equality established by the union.