BERLIN – Angela Merkel secured a fourth term as chancellor on Sunday, but her election victory was overshadowed by a far-right surge that will put an openly racist party into the center of German politics for the first time since World War II and send shockwaves across the European continent and beyond.

The anti-immigrant Alternative for Germany (AfD) garnered around 13 percent of the vote, according to preliminary returns — a result expected to upend the consensus-driven culture that has marked Germany's postwar political landscape.

Though Merkel secured another term, her center-right bloc recorded its worst result since 1949, winning around 33 percent of the vote, down from over 41 percent in 2013. Most polls in the days before the election had predicted Merkel's bloc would finish in the mid-30s, with the AfD getting about 10 percent.

“We don’t need to beat around the bush,” Merkel told supporters at party headquarters Sunday evening. “We wanted a better result, that is clear.”

The center-left Social Democrats (SPD) fared even worse, scoring about 21 percent, the worst postwar finish for a party that has been a pillar of German political life since the 19th century. Party leader Martin Schulz vowed to head into opposition, abandoning the "grand coalition" with Merkel that has governed Germany for eight of the past 12 years.

“We clearly didn’t succeed in holding our traditional base,” a visibly shaken Schulz told his party faithful, calling the AfD’s strong showing “particularly worrying” and a “turning point.”

With another grand coalition off the table, that leaves a three-way combination of Merkel’s CDU/CSU bloc with the liberal Free Democrats (FDP) and the Greens as the only viable option. Those two smaller parties won about 10.5 percent and 9 percent, respectively.

Though such a coalition would enjoy a comfortable majority in parliament, the ideological differences between the Greens, the Free Democrats and the Christian Social Union (CSU), the Bavarian sister party to Merkel’s CDU, could prove challenging.

That's particularly true when it comes to immigration. While the FDP and the CSU are demanding a harder line on asylum, both Merkel and the Greens are opposed. The CSU, which tried and failed over the past year to convince Merkel to accept an upper limit on refugees, is likely to renew that push as the party heads towards state elections in Bavaria, where it enjoys an absolute majority, next year.

Some in Merkel's circle worry that in wake of Sunday's result — the CSU scored below 40 percent in Bavaria, its worst-ever result — tensions between the two sister parties will worsen.

Germans abandoned the governing "grand coalition" and locked to smaller parties.

"The CSU will be the toughest partner in coalition talks," a senior CDU official said.

The question of Europe's future could prove just as daunting as immigration in the coalition talks. Though Merkel and the Greens are open to proposals by French President Emmanuel Macron to shore up the eurozone in the wake of the Greek crisis, the FDP has taken a more skeptical view. In a post-election television debate with Merkel and other party leaders, FDP chief Christian Lindner didn't rule out reforming the currency bloc, but said setting up a budget that could be used to send money to France and Italy "would be unthinkable and a red line for us."

Many conservatives in Merkel's own ranks — especially the CSU — also oppose such moves, suggesting that Macron's eurozone vision, which he is expected to detail later this week, won't be realized anytime soon.

Greens leader Katrin Göring-Eckardt, asked during the TV debate if she believed a three-way coalition could be formed, responded: "Naturally there's a lot that divides us ... I'm not sure that we will succeed."

In the run-up to the election, many observers considered a coalition between the three (known informally as a Jamaica coalition because the parties' colors correspond to those of the Caribbean nation's flag), to be a longshot, given the stark differences between them. But SPD's vow to go into opposition leaves Merkel with little choice but to give it a try.

The SPD's Schulz predicted that the trio would eventually reach an agreement, adding that it was an imperfect coalition that "will unfortunately leave Germany paralyzed."

Merkel rejected that appraisal, predicting she would manage to form a "stable government."

Minority government option

If the parties fail to reach a deal, a Merkel-led minority government would be an option. Yet most political observers believe new elections would be the more likely alternative in order to form a government with a clear mandate.

As Germans abandoned the governing "grand coalition" of Merkel’s conservatives and the Social Democrats (SPD), they flocked to smaller parties, vaulting both liberal Free Democrats and the far-right AfD into the Bundestag, the German parliament. The liberals crashed out at the last general election, after serving as Merkel's junior coalition partners.

The AfD saw its support swell during Germany’s refugee crisis only for it to wane earlier this year. But it charged back in the final month of the campaign. The surprise finish by the populist party will reverberate across Europe, where a string of underwhelming finishes by populist parties, including in the Netherlands and France, fueled hope in the political mainstream that the AfD would also underperform.

The AfD's strong showing is likely to be followed by an even stronger performance by populists in Austria, where a parliamentary election is set for next month. The Alpine country's Freedom Party, on which the AfD modeled its own strategy, is expected to win about 25 percent of the vote and is likely to join the next government. Such an outcome is bound to renew fears in Europe that populist parties, many of which harbor anti-EU positions, are once again gaining ground across the region.

“We’re going to hunt Frau Merkel … We will reclaim our country and our people” — Alexander Gauland, AfD lead candidate

The AfD appears to have benefited from a groundswell of anti-establishment sentiment amid an election campaign in which it was often difficult to distinguish the positions of the main parties. Merkel, in particular, ran a campaign that avoided controversy, focusing on issues like Germany’s strong economy instead of addressing more uncomfortable topics, such as refugees and immigration.

After the results came on Sunday, Merkel lamented that "in recent weeks so much of what transpired in 2015 was rehashed."

Voter frustration was apparent in exit poll interviews, with about 60 percent of AfD voters saying they cast their ballot for the party to protest the policies of the current government. Polls also suggested that the ramifications of the refugee crisis remain a hot-button issue for many voters.

Merkel struck a conciliatory note, promising to try to win back disaffected voters in the coming years “by taking on board” their concerns and fears.

That won’t be easy. AfD leaders were emboldened by their victory Sunday night, vowing to continue the fight.

“They should get ready,” AfD lead candidate Alexander Gauland said. “We’re going to hunt them. We’re going to hunt Frau Merkel ... We will reclaim our country and our people.”