Germany ruling parties lose poll in Schleswig-Holstein
Germany's governing parties have lost elections in the northern state of Schleswig-Holstein.
Chancellor Angela Merkel's Christian Democrats (CDU) scored 31%, their lowest tally in the state for 50 years.
The CDU's national coalition partners, the Free Democrats, slumped to 8%.
The opposition SPD finished just behind the CDU on around 30%, but are expected to be able form a coalition with the Greens and a party representing the state's Danish-speaking minority.
"There were two losers in Schleswig-Holstein: the CDU and the FDP," the SPD's national chairman Sigmar Gabriel said.
The libertarian Pirate Party also did well, polling 8% and entering the state legislature for the first time.
The party, which campaigns on "digital rights" issues, had already pulled off a string of surprise state election successes, winning seats in Saarland, as well as in Berlin last year.
The vote comes ahead of another vital electoral test for Mrs Merkel - elections in Germany's most populous state, North-Rhine Westphalia.
The collapse of the liberal FDP in recent opinion polls could deprive Mrs Merkel of her coalition partner in federal elections due in 2013.
In the last state election, in Saarland in March, the FDP only won 2% of the vote.