Alphabet Inc.’s (GOOGL) Google avoided paying as much as $3.7 billion in taxes last year after legally moving 15.9 billion euros ($19.2 billion) to a Bermuda shell company, regulatory filings from the Netherlands have shown.

According to Bloomberg, which followed up on an earlier report from Dutch newspaper Het Financieele Dagblad, the search engine giant used legal loopholes, known as “Double Irish” and “Dutch Sandwich,” to prevent a large chunk of its international profits from being taxed. (See also: Double Irish With A Dutch Sandwich.)

Most of Google’s overseas advertising revenue was first collected by an Irish subsidiary before being transferred to Google Netherlands Holdings BV, a Dutch company with no registered employees. From there, revenues were sent to Bermuda-based Ireland Holdings Unlimited. No tax is paid on corporate income in Bermuda.

The company’s filings with the Dutch Chamber of Commerce showed that Google moved 7 percent more money through this tax structure than the prior year. As a result, it was reportedly taxed 19.3 percent on global profits in 2016, saving the company about $3.7 billion.

Despite attracting criticism for its tax-saving methods, Google’s use of “Double Irish” and “Dutch Sandwich,” appear to be perfectly legal. The Irish government put a stop to “Double Irish” arrangements back in 2015, although companies have been given permission to continue using the loophole until the end of 2020.

“We pay all of the taxes due and comply with the tax laws in every country we operate in around the world,” a Google spokesman said in a statement given to Bloomberg. “We remain committed to helping grow the online ecosystem.”

This latest revelation of tax dodging strategies by Google comes as the European Union explores ways to make U.S. technology companies, many of which use tax shelters, pay up more. Last year, Google was excused from paying a 1.12 billion euro ($1.35 billion) French tax bill after a court ruled that the company’s Irish-based subsidiary responsible for collecting ad revenues sold in France had no permanent base in the country. (See also: Google and Facebook's Growing Ad Dominance Calls for Caution: Pivotal.)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.