After years of back and forth with tax authorities in France, Google has settled a fiscal fraud probe, as the financial prosecutor’s office told Reuters and AFP. Overall, Google will pay a $549 million fine as well as $510 million in back taxes (€500 million and €465 million, respectively).

This is a settlement, which means that French authorities are dropping charges against Google in France. It covers activities from 2005 to 2018.

According to previous reports, the company owed around $1.3 billion in taxes. In 2014, Google started putting aside some money for a potential fine.

This is a classic story of corporate tax optimization in Europe. For multiple years, Google allegedly issued advertising contracts from its European headquarters in Ireland. Profits generated from those contracts would be taxed in Ireland.

Separately, France has been working on a tax on tech giants. In order to avoid tax optimization schemes, big tech companies that generate significant revenue in France are taxed on their revenue generated in France.

If you’re running a marketplace or advertising company that generates more than €750 million in global revenue and €25 million in France, you have to pay 3% of your French revenue in taxes.

It has generated some drama with the U.S. — President Donald Trump first said that the U.S. would be placing tariffs on French wines.

France and the U.S. eventually reached an agreement at the Group of Seven summit. The French government now hopes that the OECD finds a way to properly tax tech companies in countries where they operate in order to scrap the French tax.