Germany’s ruling coalition backed Foreign Minister Frank-Walter Steinmeier as the country’s next president Monday, paving the way for an outspoken critic of Donald Trump to become head of state.

Party leaders have been wrangling for months over whom to nominate as a successor to President Joachim Gauck, a 76-year-old pastor from the ex-communist East Germany who is stepping down due to his advanced age.

On Monday, Chancellor Angela Merkel’s conservative bloc agreed on Germany’s most popular politician, Steinmeier, whose name had been put forward by his Social Democratic Party (SPD).

Merkel, who was unable to put forward a viable conservative candidate, called the choice of Steinmeier a “sensible decision” that would stand for “stability, particularly in these uncertain times”, during a conference call with party leaders, participants said.

SPD leader Sigmar Gabriel, who is also Germany’s vice-chancellor and economy minister, told reporters Steinmeier was the right candidate “to uphold the good traditions of statesmanship that Germany has maintained since World War II”.

The new president — a figure who is meant to transcend party politics and serve as a moral standard bearer for the nation — will be elected on February 12 by a special assembly of MPs, delegates from the 16 federal states, and other notables.

Steinmeier, 60, has emerged in recent months as the German government’s most strident detractor of US president-elect Donald Trump.

He warned a day after Trump’s shock election that transatlantic relations would become “more difficult”.

“I think we must expect that American foreign policy will become less predictable for us and we must expect that the United States will be more inclined to make decisions on its own,” he said.

During the US campaign, Steinmeier was even more damning, saying the prospect of a Trump presidency was a “frightening” prospect for the world.

He compared Trump to a “hate preacher”, saying he had much in common with “fearmongers” in Germany’s right-wing populist AfD party as well as advocates of Britain’s exit from the EU.

– Stridency and pragmatism –

A veteran of the German political scene and a familiar face in world capitals, Steinmeier served as Merkel’s vice-chancellor and chief diplomat during her first “grand coalition” government from 2005 to 2009.

In his second stint as foreign minister beginning in 2013, he has at times drawn fire for attempting to keep the lines of communications open with Russia despite deteriorating relations over Ukraine.

While his Social Democrats have praised his approach as in keeping with their long tradition of Ostpolitik, critics have accused him of being a “Russlandversteher” — a “Russia apologist”.

He raised eyebrows in many capitals in June when he warned NATO against “sabre-rattling and warmongering” after it conducted military exercises in eastern Europe in response to the perceived threat posed by Russia.

Steinmeier has also been frank in expressing disapproval of Turkey’s widening crackdown following a failed military coup in July, saying it should not be used as an excuse to muzzle the opposition.

He is due in Ankara Tuesday for talks.

Media reports said that Steinmeier could be replaced by European Parliament president Martin Schulz, a Social Democrat, as foreign minister.

The choice of a nominee for president threatened to become a distraction for Merkel as she prepares for what is widely expected to be a decision in the coming weeks to seek a fourth term as chancellor in 2017.

While the pick of Steinmeier was widely welcomed, Germany’s powerful conservative finance minister Wolfgang Schaeuble warned it marked a “defeat” for the CDU ahead of an election year, according to a report in the daily Rheinische Post.

This week Merkel will welcome outgoing US President Barack Obama, with whom she shared an often close working relationship during his eight years in power.

Merkel — arguably the world’s second most powerful democratic leader — is expected to chart a pragmatic course with Trump even as she has insisted she will hold him to basic democratic principles and values.