Facebook said on February 23 it will lift a contentious ban on Australian news pages, after the government agreed to amend a world-first law requiring tech giants to pay media companies.

Treasurer Josh Frydenberg and Facebook said a compromise had been reached on key aspects of the law, which was fiercely opposed by the tech companies.

“As a result of these changes, we can now work to further our investment in public interest journalism, and restore news on Facebook for Australians in the coming days,” said Will Easton, managing director of Facebook Australia.

The social media firm sparked global outrage last week by blacking out news for its Australian users and inadvertently blocking a series of non-news Facebook pages linked to everything from cancer charities to emergency response services.

Prime Minister Scott Morrison had angrily accused Facebook of making a decision to “unfriend” Australia.

But the last minute compromise – as parliament looks set to pass the law this week – means that Facebook and Google, which was also targetted, will not be penalised so long as they reach some deals with local media firms to pay for news.

They will also get an additional two months to broker those agreements.

The tech firms had fiercely opposed the legislation from the get-go, fearing it would create international precedent that would threaten their business models.

“There is no doubt that Australia has been a proxy battle for the world,” said Frydenberg.

In particular, the companies objected to rules that made negotiations with media companies mandatory and gave an independent Australian arbiter the right to impose a settlement.

Google was keen to avoid creating a precedent that platforms should pay anyone for links, something they could make their flagship search engine unworkable.

Facebook – which is much less reliant on news content – had said being forced to pay for news was simply not worth it.

“We have come to an agreement that will allow us to support the publishers we choose to, including small and local publishers,” said Facebook vice-president for global news partnerships Campbell Brown.