Australia will force Google and Facebook to pay media outlets for their content, the government announced on Monday, vowing to lead the world in making the tech giants share lucrative advertising revenues with traditional media.

Treasurer Josh Frydenberg said a mandatory code of conduct – to be fully unveiled by July and made law soon after – will require the US-based firms to reimburse Australian media companies for using their news and other content.

“It is about holding these tech titans to account, about ensuring genuine competition, [and] it is about delivering a level playing field,” Frydenberg said.

“It is about keeping jobs in journalism and it is about ensuring a fair outcome for all.”

Google and Facebook have had a huge impact on Australia’s news industry, capturing two-thirds of online advertising spending.

In response to falling revenues, Australian news outlets have slashed 20 per cent of jobs in the last six years.

If Australia is successful in its efforts to ensure more advertising revenue flows to publishers, it would be the first country to do so.

France last year became the first European state to implement an EU copyright directive that requires payment for reproduced news content, but Google has so far refused to pay and instead said it would no longer display French reports.

The impasse has prompted the country’s competition authority to order the firm negotiate with publishers.

A similar battle has played out in Spain, where Google News has not reopened since the country passed legislation in 2014 requiring payment for articles.