Companies from Amazon to FedEx have slashed their corporate tax bills by establishing a minimal presence in the tiny European country of Luxembourg, according to a report on Wednesday.

More than 340 companies have saved billions of dollars by routing money through the country, which has historically had low corporate tax rates, according to an International Consortium of Investigative Journalists report, which was based on thousands of pages of leaked documents.

The deals were set up for about eight years, through 2010, and would sometimes involve other tax havens like Ireland and Delaware, documents show.

Luxembourg, which is in between Belgium and Germany and has a population of about 525,000, negotiates private tax deals with companies — a practice that has angered officials of the European Union, where taxes are usually higher.

The leaked documents are connected to deals that were allegedly negotiated by accounting giant PricewaterhouseCoopers, which denied any wrongdoing.

Luxembourg’s defenders say there is nothing wrong in the way the deals were structured, and everything is legal.