The EU has threatened Hungary’s Viktor Orban with legal action at the European Court of Justice unless he drops LGBT+ legislation the commission has labelled discriminatory.

Member states including Belgium, Luxembourg and the Netherlands will lead the charge against the Hungarian prime minister at an EU summit on Thursday over a bill that prohibits gay people or gender reassignment from appearing on material in schools for under-18s, according to several diplomats.

The clash comes after rising tensions between EU countries and Budapest’s nationalist government, which has argued that matters of sexual orientation should not be taught in schools.

Ursula von der Leyen, the European Commission president, said the bill, which requires final approval from Hungary’s president, contravened fundamental rights.

“This bill clearly discriminates against people based on their sexual orientation,” she said on Wednesday. “It goes against the fundamental values of the European Union: human dignity, equality and respect for human rights.”

German chancellor Angela Merkel said the “law is wrong” on Wednesday.

Brussels and many EU capitals have intensified their condemnation of Orban’s rightwing government after years of tensions with Budapest over the rule of law. One EU diplomat said the LGBT+ bill reflected one of the “worst moments” in EU-Hungary relations.

In a letter to Budapest’s justice minister sent on Wednesday, EU commissioners Didier Reynders and Thierry Breton said Brussels would “not hesitate to take action in line with its powers under the Treaty”, if the bill wins final approval in its current form.

The EU has limited powers to demand amendments to draft legislation, but can sue member states that breach its treaties at the ECJ. The commission’s letter lists the range of laws that are breached by Hungary’s LGBT+ legislation, including the EU’s Charter on Fundamental Rights, audio visual and media regulation, and rules governing the provision of services in the single market.

The commission has said the bill de facto equates homosexuality and trans gender issues as being “on the same footing as pornography and are considered as capable of exerting a negative influence on the physical and moral development of minors”.

Budapest’s anti-LGBT+ bill has also sparked tensions with European football’s governing body Uefa, which refused a request from the Allianz Arena in Munich to light up the stadium in rainbow colours for Wednesday’s match between Hungary and Germany at the Euro 2020 football championship. Uefa said the move breached its ban on the display of political symbols given the “political context” in Hungary. Some German football fans, nonetheless, turned up wearing rainbow colours for the game — which ended in a 2-2 draw, a result that saw Hungary finishing bottom of their group and headed home.

The Hungarian government has argued the bill has been designed to “protect the rights of children, guarantee the rights of parents and does not apply to the sexual orientation rights of those over 18 years of age, so it does not contain any discriminatory elements”.

“The statement by the president of the commission is a shame because it publishes a biased political opinion without a previously conducted, impartial inquiry,” said a statement from the Fidesz government.

A senior EU diplomat said countries would use Thursday’s summit to persuade Orban to step back from implementing the bill. “In the past, Orban’s government has taken back legislation. Let’s hope this is done swiftly because the [LGBT+ bill] is beyond what we can accept.”