The European Union has said Amazon should pay €250m (NZ$470m) to Luxembourg after receiving years of illegal tax treatment.
EU competition commissioner Margrethe Vestager said that around three quarters of the online retail giant's profits were not taxed by Luxembourg under a deal agreed between the company and the Duchy between 2003 and 2011.
This allowed the company to gain an unfair advantage by paying four times less than other companies for eight years.
Amazon recorded its sales across the EU in Luxembourg, but was able to move its profits to a separate entity that allowed it to send money to the company's headquarters in the US, the commission said. Ms Vestager said this was illegal under state aid rules and ordered Luxembourg to recoup the money, plus interest.
In a separate announcement on Wednesday, the commission said it would take Ireland to the European Court of Justice for failing to recoup €13 billion (NZ$21b) in taxes from Apple. It comes a year after Ms Vestager said that Ireland had given Apple preferential treatment that allowed it to avoid taxes on European profits.
The Amazon decision could prove awkward for European Commission president Jean-Claude Juncker, who was Luxembourg's prime minister and finance minister at the time of the alleged deal.
Amazon said it would appeal. "We believe that Amazon did not receive any special treatment from Luxembourg and that we paid tax in full accordance with both Luxembourg and international tax law," the company said.
"We will study the commission's ruling and consider our legal options, including an appeal. Our 50,000 employees across Europe remain heads-down focused on serving our customers and the hundreds of thousands of small businesses who work with us."
Vestager said: "Luxembourg gave illegal tax benefits to Amazon. As a result, almost three quarters of Amazon's profits were not taxed. In other words, Amazon was allowed to pay four times less tax than other local companies subject to the same national tax rules.
"This is illegal under EU State aid rules. Member states cannot give selective tax benefits to multinational groups that are not available to others."
The commission has been accused of protectionism for targeting major US companies in competition investigations in recent years. Its recent decisions include fining Google NZ$3.9b in June for abusing its search monopoly and a €110m (NZ$180m) fine for Facebook over its 2013 acquisition of WhatsApp.
Vestager denied that she was deliberately targeting US companies.
"This is about competition in Europe, no matter your flag, no matter your ownership, and its for all businesses to see that paying taxes is part of doing business in Europe," she said.