The U.S. and five European governments reached an agreement resolving a trade dispute over digital taxes on some of the largest American tech giants, after nations reached a broader global accord to overhaul levies on big corporations.

Under the deal, the U.S., U.K., France, Italy, Spain and Austria agreed on “the transition from existing digital services taxes to the new multilateral solution, and have committed to continuing discussions on this matter through constructive dialogue,” according to a joint statement on the deal Thursday.

The agreement ends a long-running dispute that had threatened to derail a wider pact reshaping how countries around the world will tax multinational corporations. Through talks sponsored by the Organization for Economic Cooperation and Development, 136 countries have signed on to that plan. World leaders are expected to endorse it at an Oct. 30-31 Group of 20 summit in Rome.

Under Thursday’s side deal, the European countries will retain, for now, so-called digital services taxes on giants like Facebook Inc. and Amazon.com Inc., which U.S. officials said were being unfairly discriminated against. That lets the nations maintain revenues and keeps the pressure on Congress to approve the new rules despite opposition from leading Republicans.

If and when a new global tax regime comes into force in the next two years, The European countries will offer a credit to effectively refund any taxes collected in excess of what corporations would pay under the global tax deal.

For its part, the U.S. agreed to drop retaliatory tariffs it had enacted, and temporarily suspended, against the five European nations.

“This agreement means that our digital services tax is protected as we move to 2023, so its revenue can continue to fund vital public services,” U.K. Chancellor of the Exchequer Rishi Sunak said in a statement.

Deal Deadline

The text of Thursday’s digital-tax agreement indicated that it will fall apart if the global accord fails to be implemented by Dec. 31, 2023. Without that, the European digital levies would remain in force and the U.S. would be free to reimpose its tariffs.

In a key portion of the global agreement, countries will reallocate some of the taxes paid by the biggest multinationals to countries where the firms do business, and away from countries where they book those profits. That will address a growing concern among governments that digital commerce allowed big tech companies increasingly to engage in cross-border business without being subject to taxes in the countries where they sold goods and services.

Led by France, a number of European countries became impatient over the slow pace of OECD talks and began enacting digital levies unilaterally. France collects around 350 million euros ($408 million) a year from its tax.

This angered U.S. officials, who saw the digital taxes as unfairly discriminating against U.S. firms. Washington subsequently imposed retaliatory tariffs, including levies on French wine and cheese. The tariffs were suspended to allow for negotiations.

The OECD talks accelerated in 2021 after the U.S., under President Joe Biden, engaged in the negotiations with fresh proposals. Earlier this month, governments resolved key details. Among those was an agreement to prohibit any new digital services taxes. Countries also pledged to resolve disputes over existing DSTs, pointing toward Thursday’s side agreement.

The five European countries said they will withdraw their DSTs if and when the full global tax deal comes into force. In the transition period, if those governments end up collecting more from their DSTs than they would under the incoming rules, they would refund the difference through a tax credit, according to Thursday’s statement.

“This enables us to avert the impending U.S. punitive tariffs and keep our rules until the global tax reform comes into force,” Austrian Finance Minister Gernot Bluemel said in a statement.