The Berlin election on Sunday was bad news for Angela Merkel and her Christian Democratic Union (CDU) but it was not as shocking as the vote in Mecklenburg-Western Pomerania two weeks ago.

Putting the result in a more positive light, the CDU is the second-strongest party in the German capital - behind the Social Democratic SPD. The CDU also managed to hold off Alternative for Germany (AfD). Thus the CDU's traumatic experience of being overtaken by the rightwing populists in Mecklenburg-Western Pomerania did not repeat itself.

Michael Müller of the SPD keeps his post as Berlin's mayor

Nevertheless it was the worst-ever showing of the CDU in Berlin. By capturing only about 18 percent of the vote the party will not be able to continue its ruling coalition with the SPD, as they failed to maintain enough of a majority for their grand coalition. Both major parties suffered serious vote losses, with the SPD down by 6.7 percentage points, and the CDU by 5.8 percent.

Leading CDU politicians emphasized the loss in exactly those terms. "Both parties had similar losses," said CDU Secretary General Peter Tauber. "A sad day for the popular parties," commented Minister of Cultural Affairs Monika Grütters, who hails from the CDU's Berlin state association. The result puts more pressure on Chancellor Angela Merkel than anyone else. Half of the voters questioned in a poll said that the CDU's poor performance was the chancellor's fault.

Top candidate Frank Henkel, for Berlin's CDU the election result was a disaster

SPD Chairman Sigmar Gabriel, on the other hand, can breathe a sigh of relief. The Social Democrats still have the mayorship in Berlin, so Michael Müller will remain in office.

AfD in double digits again

Just as the CDU's downward trend was maintained, the populist AfD continued to ride its wave of electoral success. The rightwing group will take its place in Berlin's parliament for the first time after winning 14 percent of the vote. Yet the result is not as good as had been predicted prior to voting. In the end, AfD was only the fifth-strongest party in Berlin - behind the SPD, CDU, the Greens and the post-communist Left Party.

The AfD was able to pick up most of its votes (53,000) from former non-voters. That is the probable reason why voter participation was up by seven percentage points. AfD's second largest voter block (32,000) was made up of former CDU voters, thus making the AfD the CDU's biggest challenger.

Jörg Meuthen, AfD co-chairman, says his party is on the way to the Bundestag, Germany's federal parliament.

AfD Co-Chairman Jörg Meuthen said the reason for his party's success was the fact that it addresses the "burning issues that occupy the people" such as the refugee crisis and domestic security. Meuthen said he considered the AfD has established itself in both the east and the west of Germany and now also in the cities. The AfD is represented in 10 of 16 state parliaments. Meuthen is also confident that the AfD will win a double-digit percentage of the vote in next September's federal parliamentary election and take seats in the Bundestag.

Red-Red-Green, or with CDU nonetheless?

The other victor in Berlin was the pro-business FDP, which clawed its way to winning almost 7 percent of the vote. At the last election the FDP got the axe but now they actually have a chance of governing again.

The SPD is considering three possible ruling coalitions: SPD/Left Party/Green Party, or SPD/CDU/FDP, or SPD/CDU/Green Party. Exploratory talks are unlikely to be easy but Müller said he wanted to hold meetings with all parties except the AfD.

Before the vote, Müller made it clear that he would prefer a ruling coalition with the Green Party. But he doesn't have the votes for that. An alliance with the Greens and the Left Party would not be universally welcomed by some parts of the SPD, and not necessarily by Müller either. That arrangement would force the SPD to move too far to the left, which could in turn strengthen AfD.

Therefore, an alliance with CDU and FDP will also be taken into consideration. The third option, that of SPD/CDU/Green Party, would no doubt give the Greens headaches. On the eve of the election, the Green Party top candidate Ramona Pop said that she did not want to be the one to enable a SPD/CDU majority.

The federal parties were to confer about the results on Monday morning.