Australia has passed a world-first law aimed at making Google and Facebook pay for news content on their platforms.
The legislation had been fiercely opposed by the US tech giants, with Facebook blocking all news content to Australians over the row.
Facebook agreed to reverse its decision after robust negotiations with the government, which led to changes to the law to address some of their concerns.
The law is seen as a test case for similar regulation around the world.
The amended legislation - the News Media Bargaining Code - was passed by Australia's House of Representatives on Thursday, after earlier going through the Senate.
Facebook and Google had earlier argued the law "fundamentally" misunderstands how the internet works.
What does it mean?
The news code encourages tech giants and news organisations to negotiate payment deals between themselves, and commits Facebook and Google to invest tens of millions of dollars in local digital content.
If negotiations fail, an independent arbitrator can set the price they pay domestic media - something analysts say benefits the news groups.
The government argues this prescribes a "fairer" negotiation process between the parties, as it gives news organisations more leverage.
The Australian Competition and Consumer Commission (ACCC) - a market regulator - says publishers have had little negotiating power until now because they are so reliant on tech monopolies like Google and Facebook.
It follows an investigation by the commission into the tech firms' online advertising dominance, which showed that in 2018 for every A$100 (£56; €65) spent by Australian advertisers, A$49 went to Google and A$24 to Facebook.
The code also forces tech platforms to give notice to news publishers of changes to their algorithms, which decides which stories are being displayed.
The amended law also now requires the government to consider a platform's existing contributions to journalism - such as commercial deals with publishers - before applying the code to them.
This means Facebook and Google could escape the arbitration process entirely.
The government also has to give a platform a month's notice if it is considering applying the code.
What do Google and Facebook say?
The tech firms argue they already help news publishers by driving traffic back to news sites from their platforms.
Facebook and Google simply help people find news content in the first place, the platforms say.
Both tech companies lobbied the Australian government to amend the law, while also pursuing contracts with local news companies.
Google had threatened to withdraw its primary search engine from Australia, but the company recently agreed deals with local media companies including Nine Entertainment and Seven West Media worth an estimated A$60m ($47m; £34m) in total.
It has also signed a deal for an undisclosed sum with Rupert Murdoch's News Corporation.
In a statement on Tuesday, Facebook promised to reverse its ban on news content, however Australian news pages remain unavailable. Australian Treasurer Josh Frydenberg said the ban would be lifted on Friday.
Facebook has since signed at least one deal - with Seven West Media - and is in talks other Australian news groups.
Both firms have also committed to spending $1bn each in the news industry globally over the next three years.
When Facebook decided to restore news content in Australia, the big question became who blinked first: Australia or the tech giant?
But this was really a major face-saving exercise.
The government - which was blindsided by the social media company - can say triumphantly that it convinced Facebook to reverse its decision.
Facebook - which has done its reputation much damage globally by the move - can also claim it brought the highest levels of government to the negotiating table, and gained crucial amendments to a law it deeply disliked.
Compromise seems to be a key word here.
But this whole stand-off isn't just about power - it's essentially about precedent. The world is watching this closely. And if Australia's move works, you can be sure that other countries will want to start their own negotiations.
What happens now?
Facebook's black-out of Australian news content in past week has triggered harsh criticism, both in Australia and globally.
The company has admitted it overstepped in also removing over 100 non-news pages, including key health and emergency agencies.
But its powerful action has been interpreted as a warning shot to lawmakers elsewhere - such as in Canada, the UK and the EU - who have expressed interest in Australia's law.
As more news readership has shifted online, tech giants have faced calls internationally to pay more for news stories hosted on their platforms.
They have also faced increased scrutiny over their power, including calls for them to do more to combat misinformation and abuse.