EU countries have approved the use of weedkiller glyphosate for the next five years after a heated debate over whether it causes cancer.
Diplomats said Germany swung the vote, coming off the fence after abstaining in previous meetings to oppose its key EU partner France, which wanted a shorter licence extension.
The European Commission said in a statement that 18 countries had backed its proposal to renew the chemical's licence, with nine voting against and one abstaining, declaring this to be a "positive opinion".
Europe has been wrestling for the past two years over what to do with the chemical, a key ingredient in Monsanto's top-selling Roundup, whose licence was set to expire on Dec. 15.
The chemical has been used by farmers for more than 40 years, but its safety was cast in doubt when a World Health Organization agency, the International Agency for Research on Cancer (IARC), concluded in 2015 it probably causes cancer.
The European Union agreed to roll over the licence for 18 months pending the results of a study by the European Chemicals Agency, which said in March this year that there was no evidence linking glyphosate to cancer in humans.
Protest groups, however, seized on the IARC report, questioned the science in other studies and complained about the influence of big business.
In theory, the Commission could have pushed through a licence extension, but it said it wanted governments to make the call on an issue that has become so politically charged. After a series of indecisive votes, they finally produced a clear majority in favour of the Commission's proposal.
"Today's vote shows that when we all want to, we are able to share and accept our collective responsibility in decision making," said health and food safety commissioner Vytenis Andriukaitis.
Diplomats said the key swing vote came from Germany, whose government is still operating in an acting capacity following an indecisive September election. Berlin abstained earlier, but threw its weight behind a decision opposed by France.
Three other abstainers, Poland, Bulgaria and Romania, all did likewise leaving only Portugal on the fence. The result could scarcely have been closer. The extension required 16 states representing 65 percent of the Union's population to vote in favour. The 18 supporters account for 65.7 percent.
France to ban glyphosate within three years
After France's defeat in the tight vote, French President Emmanuel Macron said he would take all measures necessary to ensure glyphosate was banned in France as soon as an alternative was available - and at the latest within three years.
Despite the five-year extension approved by the Commission, EU rules allow France to unilaterally ban the substance. It has already decided to do so for private individuals in 2019.
"Five years is too long," Environment Minister Nicolas Hulot said on RTL radio, adding: "Three years seems to be a reasonable timeframe to get everyone on board."