Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

BERLIN, Germany — Members of Germany's Social Democratic Party have voted in favor of joining a coalition with Chancellor Angela Merkel's conservative bloc.

The decision clears the last major hurdle to the formation of a new government and a fourth term for Merkel.

Sunday's announcement by the party's leadership ends almost six months of uncertainty in German politics, the longest the country has been without a government in its post-war history.

The center-left Social Democrats had furiously debated whether to extend the so-called grand coalition for another four years after suffering a slump in last year's election.

A poll published on Sunday showed the SPD falling one percentage point to 16 percent, its lowest ever reading in the survey. That means it has less than half the support of the conservatives and puts it just one point ahead of the far-right Alternative for Germany (AfD).

SPD acting leader Olaf Scholz said on Saturday that turn-out in the poll had been "very, very high" after an intense internal campaign that pitted the party's pro-coalition leadership against its more radical youth wing, which campaigned for "No."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In the end, two-thirds of the party's 464,000 members approved a coalition deal.

Parliament is expected to meet next week to elect Merkel as chancellor, confirming her position as one of Europe's dominant politicians.

During the period of uncertainty over her future, however, Merkel has been somewhat overshadowed on the international stage by French President Emmanuel Macron.

Before a phone conversation this week to discuss the war in Syria and Russian nuclear arms, Merkel and President Donald Trump had not spoken to each other in over five months.

Donald Trump and Angela Merkel pictured in Hamburg in July 2017. Carlos Barria / Reuters

That gap, described by diplomats on both sides of the Atlantic as shockingly long, underscores the challenge Merkel faces as she forms the new coalition government later this month and, as German officials suggest, tries to reset the relationship with Trump.

A strong believer in close transatlantic ties, Merkel was the go-to leader in Europe for both Presidents Barack Obama and George W. Bush when Washington and Berlin were navigating the global financial crisis, Russia's annexation of Crimea from Ukraine and Iran's nuclear programme.

But her relationship with Trump got off to a frosty start and has never recovered.

German government officials play down the prolonged "radio silence" between Merkel and Trump, noting that the chancellor has ratcheted back her contacts with many foreign leaders during the months of arduous coalition talks at home.

They say the dialogue between Germany and the United States at lower levels of the government remains strong.

Some question whether any foreign leader can influence Trump, who shocked his European allies again on Thursday by announcing plans to introduce hefty tariffs on imported steel and aluminium, sending financial markets reeling on fears of a trade war.

Still, the contrast between Merkel's icy start with Trump and the rapport that French President Emmanuel Macron has developed with the American president is stark.

German officials still expect Merkel — who has continued to talk with Russia's Vladimir Putin and Turkey's Tayyip Erdogan during times of acute bilateral tensions — to do her best to re-engage with Trump over the coming months.

The two will see each other at a G7 summit in Canada in June and at a NATO summit in Brussels a month later.

U.S.-German contacts may pick up when Merkel finally forms a new government.

As Europe's largest economy and pre-eminent power broker, Germany is crucial to the region's fortunes. Berlin's partners are eagerly awaiting a new government to help drive forward Brexit talks, euro zone reform and EU diplomatic initiatives.