Angela Merkel's CDU suffered because of the Greek rescue package
German Chancellor Angela Merkel's party and its coalition allies have been defeated in regional elections in North Rhine-Westphalia.
The sharp fall in support for Mrs Merkel's party means her national coalition will lose its slim majority in the upper house of parliament.
The campaign has been overshadowed by the government's decision to contribute to a huge rescue package for Greece.
Meanwhile many cities in NRW are on the brink of bankruptcy.
Final results showed Mrs Merkel's Christian Democrats (CDU) with 34.6% and their Free Democrat (FDP) allies on 6.7%.
The Social Democrats (SPD), Germany's main opposition party, polled 34.5% of the vote, while the Greens won 12.1% and the Left Party 5.6%.
North Rhine-Westphalia (NRW), Germany's most populous state and home to 18 million people, is in the country's industrial heartland and regarded as a weathervane for national politics.
Foreign Minister Guido Westerwelle, who is also vice-chancellor and leader of the Free Democrats, called the loss a "warning shot for the governing parties".
"We must make an effort to win back lost trust," he said.
The coalition in NRW between the CDU and the pro-business FDP had mirrored the one at the federal level.
It was not immediately clear what type of alliance or coalition would emerge in NRW.
Sunday's vote gave the CDU 67 seats in the state legislature and their FDP allies 13 seats. The SPD also hold 67, the Greens 23 and the Left Party 11.
By Steve Rosenberg, BBC News, Berlin
It's only one regional election, but it matters because defeat in North Rhine Westphalia deprives Chancellor Angela Merkel of a majority in the upper house of the German parliament. And without that, she'll find it much harder to push through the national legislation she wants.
The multi-billion euro bailout of Greece may be one reason that voters have turned against her. The rescue package is extremely unpopular with the German public.
But it's not just Greece. Ever since they took power nationally, Chancellor Merkel's coalition of Christian Democrats and Free Democrats haven't stopped squabbling - over everything from body scanners at airports to budget deficits. And the more they've bickered, the more unpopular they've become.
The leader who's been nicknamed "Iron Angie" is suddenly looking weaker.
But on a national level, the result means Mrs Merkel will lose her automatic majority in the upper house of parliament, the Bundesrat, and will rely on opposition support to push through policy.
This is expected to jeopardise long-promised tax cuts and health system reforms.
Mrs Merkel had campaigned in the state until the last minute in an effort to prevent the result that was forecast in the polls.
With the economic crisis dominating the campaign, opponents accused Mrs Merkel of attempting to delay a decision on the hugely unpopular rescue package for Greece until after the poll.
In NRW, local councils are sinking into debt, leading to rising kindergarten fees and the threatened closure of libraries, swimming-pools and theatres.