Europe’s top human rights court ruled on Tuesday that Russia’s so-called “gay propaganda” ban violates international agreements protecting free speech and prohibiting discrimination.

Some regional governments in Russia adopted versions of this legislation beginning in 2003, and it was enacted nationwide in 2013, setting up a showdown over LGBT rights ahead of the 2014 Winter Olympics in Sochi. The law technically prohibits “propaganda of non-traditional sexual relationships to minors,” but authorities have also used the rule to justify shutting down LGBT rights protests, and to fine a newspaper for reporting on LGBT issues. The law led to an investigation of Apple after the company rolled out gay-friendly emojis for the iPhone, and has been invoked in bizarre campaigns against everything from a statue of a pair of dolphins, to a video of a tiger befriending a goat.

Tuesday’s ruling came in a lawsuit brought by three LGBT rights activists, who were fined under local versions of the ban for protests staged between 2009 and 2012 at venues including a building used by the city administration of St. Petersburg, a children’s library in Arkhangelsk, and a school in Ryazan. After losing appeals at Russia’s Constitutional Court, they took their case to the European Court of Human Rights. The ECHR enforces a human rights convention ratified not only by all EU member states, but also by Russia and 18 additional countries.

The ECHR ruled that the ban violates international law, and rejected all the Russian government’s justifications for the provision.

“Above all, by adopting such laws the Court found that the authorities had reinforced stigma and prejudice and encouraged homophobia, which was incompatible with the values – of equality, pluralism and tolerance – of a democratic society,” the ECHR wrote in an opinion agreed to by six of the seven judges who reviewed the case.

The judgment reiterated that “the Court has consistently refused to endorse policies and decisions which embodied a predisposed bias on the part of a heterosexual majority against a homosexual minority,” and that the provision conflicted with a “clear European consensus about the “recognition of individuals’ right to openly identify themselves as gay, lesbian or any other sexual minority, and to promote their own rights and freedoms.”

The ECHR also dismissed the Russian government’s claims that inappropriate material could “convert” children to homosexuality.

“The Court found that the Government had been unable to provide any explanation of the mechanism by which a minor could be enticed into ‘[a] homosexual lifestyle’, let alone science-based evidence that one’s sexual orientation or identity was susceptible to change under external influence,” the judges wrote.

The lone Russian judge on the panel, Dmitry Dedov, dissented from the ruling in an opinion that said “positive image of homosexuality adversely affects the development of children and puts them under risk of sexual violence.”

The decision orders the Russian government to pay €49,000 to the activists who brought the suit. This includes €20,000 awarded to Nikolay Alekseyev, a controversial LGBT activist who infuriated LGBT rights supporters by defending the Russian government’s rights restrictions in the run-up to the 2014 Winter Olympics. More recently, Alekseyev filed suit against the newspaper that uncovered the wave of kidnappings and torture of LGBT people in the Chechnya region, which the newspaper reported were triggered by Alekseyev’s application to hold an LGBT rights demonstration in a neighboring region.

The Russian Ministry of Justice vowed to appeal the ruling, which is supposed to bind the courts of Russia under the terms of the European Convention on Human Rights. But Russia has repeatedly thumbed its nose at the ECHR’s authority in recent years, including adopting legislation in 2015 allowing for ECHR rulings to be ignored when they contradict the Russian Constitution.