Canada lost an appeal at the World Trade Organization on Monday in a ruling on incentives offered to local companies, a case that has already led to legal challenges over suspicions of similar perks elsewhere.
Japan and the European Union brought the case over a scheme intended to promote renewable energy in the province of Ontario.
It offered above-market prices for electricity supplied by renewable energy companies but only offered the premium to firms who bought most of their equipment locally.
Monday's appeal decision revised some of a December ruling in which the Japan and the EU had won most of the case.
But it left in place the key finding that Ontario's incentives were illegal because they discriminated against foreign firms.
"Today's ruling is good news for everyone caring about clean energy and the environment: it has been made clear that use of quality, cost-effective technologies should not be hampered by protectionist measures," EU trade spokesman John Clancy said in a statement.
"The EU supports the promotion of renewable energy but considers this must be done in a manner consistent with international trade rules," he said.
A spokeswoman for Canada's federal trade ministry, Caitlin Workman, said the government would work with the provincial authorities to respond to the WTO appeal ruling, which is final.
Ontario will have to bring its rules into line with the WTO rules or risk a claim for trade sanctions against Canada.
Canada's defeat may spur more WTO disputes by countries which are desperate for economic growth and suspect their firms are being illegally locked out of infrastructure projects abroad.
The United States has already charged India with illegally favoring local producers in its solar sector and China has hit the EU with a claim that Greece and Italy favored solar power firms that bought local components.
Other potential disputes are simmering, with Brazil, Indonesia, Nigeria, Russia, Ukraine and the United States all under scrutiny in sectors such as energy, mining, carmaking and telecoms.