Google on Friday warned Australian lawmakers it would stop offering its search engine in the country if they went ahead with a proposed law that would force the Internet giant to pay news organizations for showing their stories in its search results.

The threat is the latest and most intense in a long-running battle that has pitted Australian lawmakers and news organizations against U.S.-based tech giants Google and Facebook. For years, news organizations in Australia have argued they should be paid when Internet companies aggregate news stories on their websites. Google and Facebook say their sites help people find news, and the resulting traffic to news websites is valuable on its own.

The proposed media law would force the tech companies to negotiate with media companies on payments for previewing and linking to their content. If they can’t reach a deal, a government regulator would step in to set the rates. That arrangement is untenable, Mel Silva, the head of Google in Australia and New Zealand, said in prepared testimony released ahead of the hearing Friday.

“The principle of unrestricted linking between websites is fundamental to the web,” Silva said. “It would give us no real choice but to stop making Google Search available in Australia.”

During the hearing, Facebook representatives also reiterated a previous threat that they could block users in the country from posting news links if the law went ahead unchanged.

The rise of Google and Facebook has massively disrupted the news business all over the world. The steady advertising revenue newspapers relied on for decades has almost entirely gone online, and news organizations have struggled for years to adjust to the new reality, with many going out of business or severely downsizing. The proposed law is written to apply to all “digital platforms,” but Facebook and Google are specifically mentioned in the text and have been at the center of the debate.

Google says it contributes billions of dollars to the Australian economy by helping businesses reach customers, distributing Australian-built software worldwide through its app store and even saving drivers time by offering Google Maps. Around 94 percent of searches in the country go through Google, according to Australia’s competition regulator. For Google, though, Australia represents only a tiny amount of its overall revenue and profit.

The idea that Google should pay for showing news in its search results is not new. In Spain, Google shut down its news aggregation website in 2014 after the country passed a law requiring online platforms that profit off news links to share their revenue with media companies. Just this week, Google agreed to negotiate payments to French publishers.

In the United States, Google is facing multiple federal and state antitrust lawsuits that allege the company has used its domination of online search to benefit its other businesses and push out competitors.

“It seems very peculiar to me that effectively Google wants to blackmail Australian consumers and policymakers with threats to go ahead and leave this jurisdiction when these discussions are happening all around the world, including in the U.S. itself,” Australian Sen. Andrew Bragg said during the Senate hearing, which was broadcast remotely.

Google says it is willing to pay Australian publishers and encourage users to subscribe to news organizations, but on its own terms. Its proposal, known as Google News Showcase, would mean news organizations negotiate directly with Google over payments.

But the Australian law would force Google and Facebook to hand over the final decision to regulators, a situation Silva said presented “unmanageable financial and operational risk for Google.”