An exit poll by leading German TV network ARD showed the CDU plunging to 20.5 percent of the vote, down from 42.6 in the last election here in 2008. The drop of 22.1 percentage points was the steepest decline ever between two elections for the CDU. The opposition Social Democrats (SPD) won 49.5 percent of the vote, up from 34.1 percent in 2008, ARD said. The SPD was projected to win 65 seats in the Hamburg state assembly, four more than needed for an absolute majority.

Hamburg is the first of seven state elections this year. The loss of three seats in the Bundesrat upper house, which represents Germany's states, will make it harder for Merkel's CDU-Free Democrats coalition to pass legislation.

The Bundesrat has to approve about half of the legislation that passes through the Bundestag lower house. The rout in Hamburg, where Merkel was born, will also send a signal to voters before the other state votes, especially in the southwestern region of Baden-Wuerttemberg where her CDU is also in danger of losing power in March.

"The winners will be hoping this result will help mobilise their supporters in other states, that's the message tonight," Karl-Rudolf Korte, a political analyst at Duisburg University, told ZDF television.

Merkel's party, which has been recovering nationally from a plunge in popularity last year, is facing other setbacks. Popular Defence Minister Karl-Theodor zu Guttenberg has been embroiled in a plagiarism scandal over his doctoral thesis, allegations he has dismissed.

Bundesbank chief Axel Weber, who was seen as a key contender for the top job at the European Central Bank, said he would quit at the German central bank, a decision that media have interpreted as a blow to Merkel.

Hamburg, long a left-wing bastion, was ruled by the SPD for 44 years before it lost power to Merkel's CDU 10 years ago. The SPD's candidate Olaf Scholz, 52, purged the party of corrupt officials who cost it control of Germany's second city.

Analysts believe the SPD nationally might get a short-term boost with a second consecutive state election victory following their May win in North Rhine-Westphalia. But it is unlikely that losing Hamburg will have a lasting impact on Merkel's party.

The CDU plunged in Hamburg polls after its leader Christoph Ahlhaus, a colorless lawyer, took over from once-popular CDU mayor Ole von Beust, who abruptly quit in July. A CDU coalition with the Greens failed in November, prompting the elections.