The EU's top court has backed an almost complete EU-wide ban on the use of three insecticides, which studies have linked to declining bee populations.
Chemicals giants Bayer and Syngenta had gone to the European Court of Justice (ECJ) hoping to get the restrictions on neonicotinoids overturned.
Last month EU governments agreed to ban all use of three neonicotinoids outdoors. Seeds treated with them can still be used in greenhouses.
Many honeybee colonies have collapsed.
Scientific studies have found that the chemicals can disorientate bees, harming their ability to pollinate and return to hives.
Some other factors - notably mites and fungus - have also been blamed for the widespread bee decline.
The three neonicotinoids to be severely restricted in the EU are: clothianidin, thiamethoxam and imidacloprid.
Currently they are widely used, but from next year farms will have to find alternatives.
The ECJ ruling said the EU had correctly applied its "precautionary principle", which allows restrictions on chemicals even when conclusive evidence of harm is lacking.
In a separate ruling, the ECJ backed chemicals giant BASF in its complaint against EU restrictions on fipronil, a different class of pesticide. So the current EU regulation that restricts fipronil will have to be amended.
The ECJ said the European Commission had failed to do an impact assessment on fipronil, and that "breached the precautionary principle".