(CNN)Germany's leaders have taken a crucial step towards breaking a deadlock that has prevented the formation of a new government since elections four months ago.
German political deadlock ends as SPD votes for coalition talks with Merkel
At a special party congress in Bonn, the center-left Social Democrats (SPD) voted to begin formal coalition talks with Chancellor Angela Merkel's CDU/CSU alliance, a move that brings a new, Merkel-led administration closer to reality.
Although Merkel's political alliance emerged as the largest group in last September's elections, its support was significantly dented. Since then, Merkel has struggled to put together a viable coalition.
Some 600 SPD delegates debated the motion for several hours on Sunday before voting to launch official talks that will likely lead to a renewal of the CDU/SPD partnership of the last four years -- a so-called grand coalition ("GroKo").
At the party meeting, 362 delegates voted "yes" while 279 voted against the talks.
A "no" vote would have forced Merkel either to govern alone in a weak minority government or set the country on a path to new elections.
Speaking at a press conference in Berlin, Merkel expressed hope for the coalition.
"The most important thing for us in these coalition negotiations is that Germany build a stable government which is able to handle future questions and can find answers to them," she said.
SPD leader Martin Schulz initially ruled out a new grand coalition in September after his party's share of the vote also slumped. He repeated his pledge two months later, after initial coalition talks between the CDU/CSU and two smaller parties collapsed.
Schulz insisted that voters had given the grand coalition "the red card" and that his party, whose share of the vote fell to its lowest level since World War II, needed to rebuild itself in opposition.
He also was concerned that rejoining Merkel in government would mean the far-right Alternative for Germany, which entered the national parliament for the first time with 12.6% of the votes, would become the main opposition party.
But with few viable options remaining and the prospect of new elections looming if a government could not be formed, Schulz came under pressure to reconsider and make his party available for talks.
Delegates at a party conference in December voted by a large majority to begin exploratory discussions, which concluded last week when the parties reached a preliminary deal. Since then, Schulz has been on the road, lobbying SPD delegates around the country to support him in what was expected to be a knife-edge vote.
Many voters seem unhappy with the prospect of a new grand coalition. A recent poll from public broadcaster ARD showed that 52% of respondents did not think another "GroKo" was a good idea.
Nevertheless, European Parliament President Antonio Tajani hailed the agreement.
"The political agreement in Berlin is positive news for stability across Europe," Tajani said in a tweet. "Germany is an important player in advancing the necessary reform process for Europe to be more effective in providing answers to citizens."
Talks will begin in the next few weeks. Once a coalition deal has been reached, SPD delegates will vote on whether to approve it.
If that final hurdle is cleared a new government will be formed, but that is unlikely to happen before April or May.