AT THE headquarters of the free-market Free Democrat Party (FDP) on September 24th activists gasped as the first exit poll results were read out: Angela Merkel’s Christian Democrats (CDU) and the Christian Social Union (CSU), their Bavarian sister party, were on just 32.5%, much lower than any poll had suggested. Then, a few seconds later, came a gargantuan cheer. The FDP had almost doubled its vote share to 9%. “If you keep cheering after every sentence this will be a long night!,” a visibly delighted Christian Lindner, the FDP leader, told the crowd.

Such was the story of the night. The CDU/CSU and their Social Democrat (SPD) coalition partners both did badly. Their joint vote share fell from 67.2% to 53.5%, its lowest ever (see chart 1). So grim was the SPD result that party leaders immediately announced that they would not be available for a second “grand coalition” with Mrs Merkel, even if asked. The FDP’s stellar result saw it comfortably clear the 5% hurdle needed to join (or in this case, re-enter) the Bundestag. The Greens defied poor polling and gained four seats, while the socialist Left party added five. Most notable of all, the anti-immigrant Alternative for Germany (AfD) party soared to almost 13%.

This means that Germany’s new parliament will be the most fragmented in post-war history, with a record six parties represented (seven, if you count the CSU separately). A new, more fractious political era seems to have begun.

The most drastic change is the AfD’s arrival in the Bundestag as the third-largest party, having gained about a million votes each from the CDU/CSU and the political left (the SPD and the Left party). Its success points to the endurance of Germany’s longitudinal divide: it took a whopping 20.5% of the votes in the former communist east. It is also especially alarming in a country with Germany’s Nazi past. Two weeks ago Alexander Gauland, the AfD’s probable leader in the Bundestag, opined: “we have the right to be proud of the achievements of the German soldiers in two world wars.” The day after the election he felt it appropriate to question Germany’s relationship with Israel.

Still, the party’s success should not be exaggerated. It is a new amalgamation of old political forces in Germany, like the nationalist-conservative wing of the CDU in the west and strong residual anti-Western sentiment in the east (see chart 2), melded together by the fact that the country has taken in 1.2m immigrants in two years, an experience Mrs Merkel stresses it will not repeat. Fully 61% of the AfD’s voters said they were motivated by disappointment with the other parties (compared with 30% for the electorate overall).

Meanwhile the party’s ability to use its electoral windfall effectively is questionable: it is fractious to the point of parody. The morning after the election a newly elected Frauke Petry, the party’s former leader, announced in front of stunned colleagues at a press conference that she would not be sitting in the AfD group in the Bundestag, and walked out. She is said to be planning to found a splinter party.

Mrs Merkel’s refugee policies were a factor behind the failure of the two big parties, but far from the only one. After 12 years of the same chancellor, eight of them in a baggy coalition with the SPD, voters turned to narrower, more distinct parties in a trend that is present across much of Europe. The fragmentation of the Bundestag looks modest compared with the 13-party Dutch parliament, for example (unlike in Germany, the Netherlands has no threshold for representation).

As in the Netherlands, coalition talks could take a long time. They will only begin in earnest after a state election in Lower Saxony on October 15th. Unless the SPD changes its mind about another grand coalition, the only numerically possible option is a “Jamaica” coalition of the CDU/CSU, the FDP and the Greens, so called as their colours are those of the Caribbean nation’s flag. Such a government would have a wide ideological span and require some bending of red lines; the Greens, for instance, insist they will only enter a government that steers Germany towards a ban on cars with internal-combustion engines, while the CSU say they will only join one that does not.

But Mrs Merkel will probably manage to pull such a government together, even if it takes her until January. It would probably focus heavily on digitisation, improving education and infrastructure, subjects on which the parties broadly agree, and would be expansionary, cutting taxes (an FDP priority, and one that will help boost the wider European economy) and investing in things like renewable energy (a Green one). The Greens may take the foreign ministry, while the FDP has its eye on the finance ministry, which Wolfgang Schäuble is vacating. This means that Europe is likely to prove an area of conflict; the Greens are more federalist, while the FDP’s Mr Lindner has said that Greece should leave the euro zone and ruled out large new transfers to southern countries.

It all comes at a time when Germany is under pressure to lead in Europe, and to make concessions towards euro-zone integration (see Charlemagne). Mrs Merkel is sceptical about these anyway—she thinks the euro zone’s problems demand structural reforms in weak economies rather than more German cash—but even were she not, she would struggle to persuade her partners in a future Jamaica government.

For the chancellor has been weakened by the election result, dubbed by the Bild Zeitung, a tabloid, a “nightmare victory” for her. Her alliance has lost 65 MPs. A Jamaica coalition could prove scrappy; the FDP and the Greens spent much of the election campaign at each other’s necks over big subjects like refugees and the environment. Meanwhile the chancellor will be wary of boosting the AfD, which for all its internal squabbles will be noisy and provocative in the Bundestag, and which started life as an anti-bail-outs party focused on the euro. The next round of Greek-debt talks next summer could be especially tricky. Daniela Schwarzer of the German Council on Foreign Relations stresses Germany’s “enormous need” to “explain to our international partners what the presence of the AfD in the Bundestag means.”

Mrs Merkel’s scope for international leadership is also constrained by tensions in her own political camp. The CSU, for example, blames the chancellor for its deep losses in Bavaria, where the party’s longstanding hegemony will be tested in a state election next year. On election night Horst Seehofer, the CSU leader, said the CDU/CSU needed to attend to its right flank: “it wouldn’t be good just to carry on as before,” he added ominously. In the CDU, too, dissent is growing. On September 26th, 53 of Mrs Merkel’s 246 MPs voted against one of her closest allies staying on as head of the Bundestag group.

Minds are also turning to the chancellor’s departure, which may have been brought forward by the mediocre result. Free Conservative Awakening, an energetic faction on the CDU’s right, is calling on Mrs Merkel to step down as party chairman (a post separate from the chancellorship). Among others it suggests Jens Spahn, the deputy finance minister viewed by some as a possible successor, for the job. The twilight of Mrs Merkel is at hand.