BRUSSELS (AP) — The European Union on Monday approved a five-year extension to the use of the weed killer glyphosate, in a move that failed to satisfy either environmentalists or farmers and pitted Germany against France.

After a drawn-out process, the EU backed the extension with a qualified majority and was able to beat a mid-December deadline when the current license expires — 18 member states voted in favor, 9 against while one abstained.

Germany put its weight behind the extension, a move that divided the caretaker government in Berlin and could have repercussions on Chancellor Angela Merkel's negotiations to form a grand coalition between her conservative bloc and the center-left Socialist Democrats.

France remained opposed and there was anger with the outcome.

"This is Black Monday for health," French European Parliament deputy Yannick Jadot told BFM TV.

But President Emmanuel Macron said he tasked the government "to take the necessary measures so that the use of glyphosate is forbidden in France as soon as alternatives are found, and at the latest in three years."

Environmentalists had hoped on an immediate ban since they claim that the weed killer, used in chemical giant Monsanto's popular Roundup herbicide, is linked to cancer. The World Health Organization's cancer agency said in 2015 that the weed killer is "probably carcinogenic" to humans.

"The decision taken today by a narrow qualified majority of member states has locked the EU into another five years of toxic agriculture," said Green member of the European Parliament Bart Staes. "This is a dark day for consumers, farmers and the environment."

Many farmers, who say the substance is safe, had wanted a 15-year extension. EU nations long failed to find a compromise amid conflicting health reports.

Despite welcoming the limited extension, the president of the EU's Copa-Cogeca farmer association, Pekka Pesonen, insisted glyphosate "should have been re-authorized for 15 years after it was given a positive assessment by both the European Food Safety Authority and the European Chemicals Agency."

Banning glyphosate outright would have shaken Europe's agriculture sector, since it is so widely used.

Germany voted for the extension over the objection of Social Democrat Environment Minister Barbara Hendricks, who said she had told Christian Democrat Agriculture Minister Christian Schmidt on the phone Monday that she was against it.

Schmidt, whose Christian Social Union is the sister party to Chancellor Angela Merkel's Christian Democratic Union, told the Rheinische Post that Germany had voted for the agreement because of conditions that will "strengthen the role of biodiversity and animal protection."

Hendricks suggested the vote could make the possibility of building a new coalition government in Germany between her party and Merkel's conservative bloc more difficult.

"Anyone who is interested in developing trust between two parties cannot behave that way," she said.

The approval also came after the Greens moved out of the picture as a possible coalition partner.

____

David Rising contributed from Berlin. Elaine Ganley contributed from Paris.