The European Parliament has voted in favour of urgent legal action over Hungary's new law banning the depiction of homosexuality to under-18s.
The new legislation breached "EU values, principles and law", MEPs said.
The parliament added that the law was "another intentional and premeditated example of the gradual dismantling of fundamental rights in Hungary".
Prime Minister Viktor Orban insists school policy is a matter for Hungary, not "Brussels bureaucrats".
In a resolution passed on Thursday with 459 in favour, 147 against and 58 abstentions, MEPs said the latest developments in Hungary followed a broader pattern of political censorship.
The parliament urged the European Commission to use a new tool that allows the EU to reduce budget allocations to member states in breach of the rule of law, to ensure that the Hungarian government reverse the decision.
It also urged legal action against Hungary's right-wing nationalist government at the European Court of Justice.
Critics say Hungary's new law, which came into force on Thursday, equates homosexuality with paedophilia.
"This legislation uses the protection of children as an excuse to discriminate against people because of their sexual orientation," EU Commission President Ursula von der Leyen said on Wednesday, calling it "a disgrace".
"Whatever they do, we will not allow [LGBT] activists into our children's kindergartens and schools," Prime Minister Orban responded.
What impact will the new law have?
The new rules introduced by Hungary focus on increasing punishment for convicted paedophiles, but an amendment was passed on 15 June banning the portrayal or promotion of homosexuality among under-18s.
While it could affect sex education and advertising, and even stop TV favourites such as Friends or Harry Potter being broadcast until late at night, there are also fears that vulnerable young people could be deprived of important support.
Teaching sex education in schools will be limited to people approved by the government.
It is not yet clear what the penalties for breaching the law will be.
What other rules has Hungary introduced?
Hungary has introduced a number of similar decisions since Prime Minister Orban took power in 2010.
In December 2020, parliament banned same-sex couples from adopting children.
Earlier the same year, the country passed a law preventing people from legally changing their gender.
Hungary also does not recognise gay marriage.
Mr Orban has been widely criticised in the EU, accused of curbing the rights of migrants and other minorities, politicising the courts and media, and tolerating anti-Semitism. He says he is defending Hungary's Christian values in a Europe gripped by left-wing liberalism.