BRUSSELS (AP) — The gay prime minister of Luxembourg used the dais of the European Union’s parliament Wednesday to stand up for LGBTQ rights in the 27-nation bloc and to chastise member state Hungary, which wants to curtail discussions of homosexuality in schools and the media.

“If there’s anyone in this house who thinks that you’ve become a homosexual by watching the television or listening to a song, then you’ve not understood anything,” Prime Minister Xavier Bettel told legislators at the European Parliament’s plenary session in Strasbourg, France. “The most difficult (thing) for a homosexual is to accept themselves.”

Bettel, 50, became prime minister of his small European country in December 2013 and married his husband eight years ago. He has often spoken about his sexual orientation and for two years, he has been especially critical of Hungary.

A 2021 law prohibited sharing content on homosexuality or gender transition in films, advertisements and other media targeting people under 18. It also banned information on homosexuality in school sex education programs.

The European Union’s executive commission and a number of member nations have challenged the measure in the EU’s Court of Justice. The European Commission said the law “discriminates against people on the basis of their sexual orientation and gender identity.”

Bettel said Wednesday that he thinks the government of Hungarian Prime Minister Viktor Orban is out of touch with the prevailing views in many other EU countries. He noted that identifying publicly as gay could be dangerous in too many nations outside the EU.

“I could end up in prison, face (a) life sentence. And soon maybe, in a European Union member state, I would only be able to talk about this in secret because I would be accused of perverting the young generation,” Bettel said.

“I am ashamed, Madam President, that some colleagues want to win votes at the expense of minorities. We’ve had that before in our history,” he said.

At an EU-Arab League summit in Egypt in 2019, Bettel told Arab leaders that he was married to a man and would probably face capital punishment in many of their countries.