IT IS not yet clear exactly who won the election on May 9th in North Rhine-Westphalia (NRW), Germany's most populous state, but it is clear who lost: the two parties that govern both the state and Germany, the Christian Democratic Union (CDU) and the Free Democratic Party (FDP), and their leaders. Foremost among the losers are Angela Merkel, Germany's chancellor and head of the CDU, as well as her foreign minister, Guido Westerwelle, who leads the FDP. Mr Westerwelle called the election results a “warning shot” to the governing parties. That is an understatement.

A majority of NRW voters said the decision to bail out Greece, approved by the Bundestag two days before the election, influenced their decision. Though voters went to the polls before European finance ministers and the IMF unveiled a €750 billion ($965 billion) to ease fears of contagion from Greece's solvency crisis, it is unlikely that Germans will be delighted with that either.

Both the CDU and the opposition Social Democratic Party (SPD) won a bit more than 34% of the vote. Although the CDU apparently finished in front by a tiny margin this is in fact a disastrous setback for the party and for the state's premier, Jürgen Rüttgers. The CDU lost ten percentage points of the vote since the last election in 2005. Its partnership with the FDP in the state will now be dissolved.

This will be seen as the beginning of a comeback for the SPD, which suffered its worst post-war defeat in last September's federal elections. But it is also further evidence of a long-term decline in support for both of the big-tent Volksparteien: the SPD outperformed expectations, but still won its lowest share of the vote in NRW since 1954. For two smaller parties the results are an unalloyed triumph (see graphic, below): the Green Party, which doubled its share of the vote, and the ex-communist Left Party, which enters NRW's legislature for the first time (and complicates the arithmetic of coalition building).

Several coalitions are now thinkable, any one of which would reverberate beyond NRW. The most difficult decision may face the SPD's leader, Hannelore Kraft. Her preferred alliance—with the Greens—has apparently fallen short of a majority. She might now have to choose between joining a “grand coalition” with the CDU, possibly as a junior partner, or bringing the Left Party into the government of a western state for the first time to top up its alliance with the Greens.

This would be risky. The Left Party is a reasonable governing partner in eastern Germany, where it has participated in several coalitions, including the current one in Berlin. But in NRW the party is a ramshackle grouping that includes professed communists. It is not clear whether a partnership with the SPD and the Greens would make the Left Party more respectable or sully the reputation of the other two. Another possible alliance would be an exotic three-party ménage consisting of the SPD, Greens and the FDP, but this looks unlikely.

Whatever coalition eventually emerges in NRW, the results are a severe blow for Mrs Merkel. Her CDU-FDP coalition will lose its majority in the Bundesrat, the upper house of the legislature. Any legislation that affects the states can now be blocked by the opposition. Worse than that, the NRW election discredits the course Mrs Merkel has set since winning a second term last September and inviting the FDP to be her governing partner.

It soon became apparent that the two parties had less in common than they had proclaimed. The FDP's top priority was to cut taxes, but voters found the idea laughable in light of the government's record deficit; the CDU was hardly less sceptical. The FDP proposed embarking on a radical reform of health-care financing, which proved unpopular both within the coalition and on the streets. Mr Westerwelle touched off a divisive debate about welfare, which many thought unbecoming the country's chief diplomat. Mrs Merkel appeared to be putting off the government's most difficult decisions until after the NRW election. As a result, voters had no clear idea where she proposed to lead the country.

And now leadership will become more difficult. Mrs Merkel must now negotiate a new framework for managing the euro without further angering an electorate already resentful at having to aid irresponsible neighbours and fearful for the currency's stability. Falling tax revenues and a new balanced-budget amendment to the constitution mean that rather than offering tax relief Mrs Merkel will have to preside over unpopular spending cuts. A consensus-loving tactician, Mrs Merkel has done too little to prepare Germans for tough decisions. It will not be easier if Finance Minister Wolfgang Schäuble, who was hospitalised during a crisis meeting on the euro in Brussels, is not at full strength.

Mr Westerwelle is also in trouble. The FDP, which won a record 14.6% of the vote in the federal election, managed less than half that in NRW. His pugnacious behaviour, which served him well in opposition, looks inappropriate in office. He may eventually face a challenge to his leadership of the FDP.

Mrs Merkel is also looking politically mortal for the first time. A latecomer to politics from eastern Germany and to the CDU, she has always been more popular with voters than in her own party. As the CDU's biggest electoral asset she had little trouble keeping rivals in line. Now that the party has performed so badly in Germany's most important state, Mrs Merkel will have to regain its confidence while she struggles to restore a sense of direction to her government.