Brazil has re-legalised so-called “gay cure therapy” as a judge deemed homosexuality to be a “disease”.

Judge Waldemar Claudio de Carvalho overruled a 1999 resolution by the Federal Council of Psychology which prohibited the treatment of homosexuality by psychologists.

The federal judge in Brasília ruled in favour of a psychologist whose license was revoked for practising “conversion therapy”.

Evangelical Christian Rozangela Justino had her license stripped in 2016 after she advised patients to seek religious guidance to “cure” their homosexuality, which Justino considered to be a “disease”.

The ruling has been met with backlash.

The Federal Council of Psychology said that it “opens the dangerous possibility of the use of sexual reversion therapies”.

Related: 10 things you’ve always wanted to ask a guy who’s been through gay conversion therapy

The Council pledged to contest the ruling, with president Rogério Giannini insisting they would be successful, having fought off numerous legal challenges in the past.

“There is no way to cure what is not a disease,” Giannini told the Guardian. “It is not a serious, academic debate, it is a debate connected to religious or conservative positions.”

David Miranda, one of the few openly gay politicians in the country, added that the decision was a “big regression to the progressive conquests that the LGBT community had in recent decades”.

“Like various countries in the world, Brazil is suffering a conservative wave,” he added.

Related: Church of England demands ban on ‘gay cure’ therapy

Some of Brazil’s biggest celebrities have condemned the ruling including pop star Larissa Machado.

Machado, who is also known by her stage name Anitta, said that the country should be focusing on worse issues it has at hand.

“That’s what happens in my country. People dying, hungry, the government killing the country with corruption, no education, no hospitals, no opportunities … and the authorities are wasting their time to announce that homosexuality is a sickness,” she wrote on Instagram.

Ivete Sangalo, another huge music influence in the country, said: “The sick ones are those who believe in this grand absurdity”.