A rainbow gay pride flag is seen during an Australian Football League match on June 9, 2018 in Melbourne, Australia. Michael Dodge—Getty Images

Australia will ban schools from expelling gay students after a leaked report revealed the practice was enforced at some religious schools, according to Agence France-Presse.

The report, commissioned to pacify the ruling coalition’s conservative wing, focused on laws that allow private and faith-based schools in some states to discriminate against homosexual students. While the report favored writing the practice into federal law, the public revelation of such a policy sparked public fury.

Catholic organizations joined the outcry, and rejected the idea that the government should legalize discrimination based on sexuality, according to AFP.

Prime Minister Scott Morrison, an evangelical Christian who opposed gay marriage, initially tried to quell the debate by insisting the review had been “misreported.” On Saturday, as the issued continued to gain traction, Morrison promised he would introduce legislation against sexuality-based discrimination to prevent “confusion and anxiety for parents and students.”

“I will be taking action to ensure amendments are introduced as soon as practicable to make it clear that no student of a non-state school should be expelled on the basis of their sexuality,” he said.

Labor Party leader Bill Shorten also said he has offered to help Morrison remove laws allowing “discrimination against children because of who they are.”

The debate around the expulsions comes ahead of an Oct. 20 by-election that could cost the conservative government its tenuous parliamentary majority.

Last year, Australia voted overwhelmingly to legalize same-sex marriage, after years of conservative resistance.