Voters in German city-state Hamburg have punished Chancellor Angela Merkel's crisis-wracked conservatives and ejected the far right from Parliament in a regional election, according to exit polls.

According to initial forecasts by public broadcasters ARD and ZDF on Sunday, Germany's centre-left Social Democratic Party (SPD) have come out on top in the Hamburg regional election with 37.5 percent of the votes.

More:

The Greens, who have been in coalition with the SPD for the last five years in the northern German port city, came second, having doubled their votes from the last election in 2015.

The result means the coalition is likely to continue.

While the SPD defended its position as the strongest force, they shed more than eight points since the 2015 polls.

Merkel's conservative Christian Democratic Union (CDU) came third with 11.5 percent, having lost more than four points - one of its worst-ever scores in any German region.

Exit polls also indicated that four days after a racist gunman killed nine people in the western town of Hanau, the far-right Alternative for Germany (AfD) would be ejected from the Hamburg parliament, falling just short of the 5-percent threshold needed.

"Nazis out," shouted supporters of the SPD and Greens as they celebrated in Hamburg.

After weeks of intense political turmoil at the national level, including never-seen-before cooperation between the centre and the far right, some 57 percent people had cast their vote two hours before the polls closed, election officials said.

The Hamburg result was "a great success", Greens national coleader Robert Habeck told ARD.



"We have a very challenging situation for democracy in Germany, and the CDU is tied up in its own problems ... It will be up to us to give the land direction and trust."

Al Jazeera's Dominic Kane, reporting from Hamburg, said the Greens' success should not come as a surprise as the party has, for several years, been riding a wave of popular public opinion about climate change.

"Many people ... desire to see greater protection, to see climate change slow down, to see policies that prioritise the environment brought to the fore," he said.

"That's certainly something that the lead candidate from the Greens party wanted to stress and it's something that she's been talking about since these exit polls emerged. The Greens have been doing very well across the board in this country and the success this evening has to be seen as part of that process."

Merkel's CDU has been sapped across Germany by a long-running leadership crisis, sharpened by its unprecedented apparent alliance with the AfD earlier in February.

Exit polls suggested that the AfD and the liberal Free Democratic Party (FDP) may both have failed to clear the 5-percent hurdle needed to enter Parliament.

The prosperous port city with a proud left-of-centre tradition may also be the first state to deny AfD seats in Parliament, just two years after it completed its sweep into all 16 German state legislatures in a post-World War II first for a far-right party.

In many other parts of Germany, AfD polled in double digits, scoring above 20 percent in several recent state elections in the former communist east.

Thuringia chaos

Earlier this month, Merkel's conservatives were shaken by the apparent alliance of their regional branch in the eastern state of Thuringia with AfD, voting in an FDP politician as state premier.

The breach of a historic political taboo provoked a nationwide backlash against both mainstream right-of-centre parties.

As a result, CDU leader and Merkel's heir apparent Annegret Kramp-Karrenbauer announced her resignation, throwing open the question of who will succeed the veteran chancellor following elections next year at the latest.

She is set to announce on Monday how the party will select a new leader or leadership team.