Sydney - Australia's conservative government will ban schools from expelling students over their sexuality, after a public outcry over the issue that threatened to sway the result of a crucial by-election and change the balance of power.
Laws allowing faith-based schools in some states to discriminate against gay students and teachers were highlighted in a review into religious protections that was leaked in the media last week.
The report - commissioned to placate the right wing of the governing coalition after Australia voted to approve gay marriage last year - called for the policy to be enshrined in federal laws.
The ensuing public outcry, with even Catholic organisations rejecting the prospect of discriminating against gay students, came ahead of an October 20 by-election that could cost the government its wafer-thin parliamentary majority.
The by-election - triggered when former prime minister Malcolm Turnbull resigned from parliament after being ousted as leader by Scott Morrison - fuelled fears of a voter backlash in the blue-ribbon seat.
Support of gay rights is particularly high in Turnbull's wealthy Sydney beachside seat of Wentworth, which voted 81 percent in favour of gay marriage in last year's national postal poll.
Morrison, an evangelical Christian who opposed gay marriage, initially blamed the furore on "misreporting" and insisted the religious review was about more protections for students against discrimination.
As the debate grew louder, the prime minister finally said Saturday that he would introduce a bill to prevent sexuality-based discrimination, to end "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.
The school bill is expected to sail through parliament with the support of the main opposition Labor Party.
The left-wing Greens party said it would also introduce amendments to end discrimination against school teachers based on their sexuality or gender identity.
"It's 2018, not the 1950s, no matter what Scott Morrison thinks," Greens leader Richard di Natale tweeted.
While the Wentworth seat is traditionally a Liberal safe haven, there have been fears within the ruling Liberal-National coalition of local anger over Turnbull's ousting.
There is currently a three-way race for the seat between the Liberals, Labor and an independent candidate.
The coalition has a one-seat majority in the lower house of parliament, and Morrison warned Wentworth voters that if the Liberals lose the seat, it could lead to a hung parliament.
That would create "unnecessary uncertainty in our economy and the stability of our government", he told reporters on Saturday.