Angela Merkel looks set to be re-elected as German chancellor for a fourth term in office after her conservative alliance won a federal election Sunday, but the celebrations at party HQ could prove short-lived.
Germany's political system is now in a state of flux with Merkel facing an uphill battle to agree a governing coalition with other smaller parties.
In the meantime, the jobs of senior German politicians and ministers could hang in the balance as the post-election wrangling begins. CNBC looks at what will happen next.
While Merkel's win is a victory for liberal, pro-European politicians and a relief for like-minded members of the electorate, the election saw Merkel's party lose substantial ground to the country's far-right, nationalist party.
While the alliance comprising Christian Democratic Union (CDU) and its sister party Christian Social Union (CSU) received 33 percent of the vote, making it the largest parliamentary group, the allies saw a collective 8.6 percentage points decrease since the last vote in 2013. Germany's other main party, the Social Democratic Party (SPD), also fared badly with 20.5 percent of the vote (down 5.2 percentage points from 2013), according to statistics from Germany's Federal Returning Officer.
Carsten Brzeski, chief economist of Germany and Austria at ING Research, said Monday that the result was a "bittersweet victory" for Merkel and could be "the worst result for the CDU since 1949" and "the worst result since World War II" for the SPD.
Many voters turned to the nationalist, anti-euro Alternative for Germany (AfD) party, which had been predicted to do well in less affluent parts of the country, particularly in the former East Germany. Gaining 12.6 percent of the vote (up 7.9 percentage points since the last election), it is now the third largest party in Germany and is set to enter the national parliament for the first time.
Merkel acknowledged the AfD's result, saying she would listen to the concerns of voters, and vowed to win them back. Whether voters who were disenchanted by Merkel's decision in 2015 to allow over one million refugees to enter Germany during the migrant crisis will forgive her remains to be seen.
Although Merkel's CDU/CSU alliance won the highest share of the vote, it has not won enough that it can govern alone, meaning it will have to find coalition partners from smaller parties in order to form a four-party government not seen in Germany for decades.
On a practical level too, the Bundestag has 30 days to convene following the election and then the parliament itself must elect the chancellor, although this will be Merkel, as Germany's biggest party always puts forward its leader as the candidate for chancellor.
The CDU/CSU's former junior coalition partner, the SPD, said it would quit the "grand coalition" of the last four years and would instead go into opposition following its dismal election result.
Calling the result a "bitter loss," Reuters reported, Martin Schulz, formerly head of the European parliament, said he would stay on as the party's leader. However, after what has been generally viewed as a lackluster election campaign, whether that position is tenable in the long-term remains to be seen.
All political parties ruled out a coalition with the nationalist AfD party and setting aside the SDP, the most likely coalition is the so-called "Jamaica" option with the CDU/CSU approaching the pro-business Free Democratic Party (FDP), which gained 10.7 percent of the vote, and the Greens, which gained 8.9 percent.
The process of trying to form a governing coalition could take months, according to Societe Generale's research team Guy Stear and Brian Hilliard – and could affect the wider direction of the European Union (EU).
"With a poor election result for the CDU and SPD… we expect the forming of a new coalition to take longer than usual. In addition, with strong results for both the AfD and the FDP, we suspect that Germany's EU policies will be more cautious and restrictive, irrespective of which coalition takes office," they said in a note Monday.
The election result could claim some top scalps with Schulz's position as head of the SDP looking vulnerable, as well as Germany's Finance Minister Wolfgang Schauble, a popular veteran of the country's political establishment.
It's traditional in Germany for the junior coalition partner to choose a ministry where it can place a minister of its choice, and with the pro-business FDP likely to be a junior coalition partner, the Finance Ministry is widely expected to be in its sights.
A member of the FDP's national executive told the Bild newspaper earlier this month that "the FDP should enter no government in which it cannot name a finance minister," but the party has been tight-lipped since the result about any upcoming coalition talks.
CNBC contacted the FDP for comment on its Finance Ministry plans but no one was available for comment.
A strong election result for Merkel was seen as a precursor for greater political and economic integration for the wider EU and euro zone, especially given her support for French President Emmanuel Macron's vision for a euro zone budget, European finance minister and greater cooperation on reforms.
The FDP has been vocal in its opposition to some of those plans, however, and could drive a hard bargain during negotiations, according to Paul Donovan, chief economist at UBS Wealth Management.
"Chancellor Merkel's negotiations with the Greens and the FDP are likely to take time; there are significant differences over EU integration, defense and environmental policies. French President Macron's integration plans may be overshadowed," he said in a note Monday.
While Teneo Intelligence's Deputy Director of Research Carsten Nickel said the German parliament would remain broadly pro-European, he said the euro zone angle would be "the main item to watch as coalition talks unfold."
"While the FDP has taken a skeptical position, this will be countered by the strong pro-EU stance of the Greens. Moreover, Merkel retains the implicit threat of returning to the SPD if Jamaica talks were to fail (especially over Europe). The (FDP) party will have to pick its fights – and some key deliverables such as tax cuts for its most loyal support base, high-income voters, might be more important than trying to oppose Merkel (and Finance Minister Wolfgang Schaeuble, who might still stay on) on euro zone reform," he said.