BRUSSELS -- The European Union has approved a five-year extension of the use of the weed killer glyphosate in a move that failed to satisfy both environmentalists and 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.

The surprise came when Germany voted for 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 Christian Democrats and Socialists. France remained opposed.

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.

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.

EU health and food safety Commissioner Vytenis Andriukaitis said that "when we all want to, we are able to share and accept our collective responsibility in decision making."

The European Commission had initially proposed a license extension of 10 years.

One official said that 18 member states voted in favour, 9 against and one abstained.

"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."

Environmentalists had been seeking to ban glyphosate, which the World Health Organization's cancer agency said in 2015 is "probably carcinogenic to humans."

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

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."

Politically, Monday's approval proved toxic in Berlin.

Germany voted for the extension over the objection of Social Democrat Environment Minister Barbara Hendricks, who said in a statement that 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 on developing trust between two parties cannot behave that way," she said.