With her centre-right Christian Democratic Union (CDU) party leading today’s vote, Angela Merkel is set to remain Germany’s chancellor, for a fourth consecutive term. This comes as no surprise. Her popularity has remained high. While her party captured a lower percentage of votes than in 2013, she was dominant throughout the campaign while her main opponent, the Social Democrat Martin Schulz, failed to mount a convincing challenge. Just a fifth of voters backed the Social Democrats (SPD), and Mr Schulz announced that he would not renew the grand coalition with Mrs Merkel, who will now open talks with the pro-business FDP liberals (at 10%) and the Greens (at 9%).

Europe’s most powerful leader has delivered yet more proof of her political resilience. Key to Mrs Merkel’s longevity is what some observers have called her strategy of “asymmetric demobilisation”: by co-opting many of her mainstream adversaries’ policies, whether on nuclear energy, minimum wage or gay marriage, she has left them very little space indeed. What space has opened up is on the extremist, nationalist fringe. By reaching 13%, the far-right Alternative für Deutschland (AfD) has come out stronger than many had anticipated during the campaign. For the first time in decades, a xenophobic and rabidly anti-European movement will be represented in the Bundestag.

The AfD draws most of its support from citizens in the east, who feel disenfranchised. Beyond those states, it has also capitalised on anxieties born from the refugee crisis, and on anti-establishment sentiment fuelled by the fact so much of the mainstream campaign was about consensus rather than about change.

The AfD surge is no doubt worrying. And it is a sign of growing political fragmentation. It introduces into German federal politics an element of toxicity and polarisation that anyone attached to liberal democracy can only be concerned about. The AfD rose from being a fringe group in 2013 to now becoming a key opposition force, with as many as 80 seats. As part of the parliament, the AfD will benefit from speaking time, state funds and more regular TV exposure – an appalling prospect.

Yet it is important not to overreact. Talk of Germany returning to the ghosts of the past would be overdone. Germany is a stable democracy. It is deeply committed to the European project. Its politics have not been upended by populist forces as has been the case in the US and the UK with Donald Trump and Brexit.

The AfD will be in the parliament, but not in government. It will remain an anomaly – if a loud, obnoxious one. It will not be a defining factor for the country’s policies on the European or global stages. None of Germany’s mainstream parties are considering entering a pact with it: they all reject its toxic messages. The AfD remains politically isolated. As a party it is a motley assortment of ambitious politicians, whose positions will come under more, not less, scrutiny.

Germany is not swerving towards the extremes, even as a protest vote has now clearly emerged. If anything, this election has shown how solidly the country’s political centre ground can hold. German stability is good news for Europe, and for liberal democracy at large. After France’s rejection of Marine Le Pen, this result adds to hopes that the EU will now come together.

Mrs Merkel must now find a way to create the best possible conditions for the EU to overcome its difficulties. A coalition including the FDP is likely to make it harder to reach an agreement with France on reforming the eurozone’s governance. Germany’s democracy is key to Europe’s stability and to its future. With the rise of the AfD, German society now has a dented shield, but not a broken one. In an unpredictable global environment, there are arguably more reassuring aspects to this German outcome than there are worrying ones. Mrs Merkel has come out the winner, albeit somewhat weakened. After so many years in office, she can only be aware that the question of what, and who, comes after her will inevitably become more pressing.