Voters in German city-state Hamburg punished Chancellor Angela Merkel's crisis-racked conservatives in a regional election Sunday, while the incumbent centre-left held off a challenge from the Greens according to exit polls.

It was a "bitter day" for Merkel's Christian Democratic Union (CDU), party general secretary Paul Ziemiak said.

According to the Infratest exit poll and estimates from public broadcasters ARD and ZDF, the centre right was ground down more than four percentage points, to just over 11 -- managing just third place with its second-worst score ever in a regional vote.

Swedish climate activist Greta Thunberg joined a massive "Fridays for Future" demonstration in Hamburg attended by around 10,000 people
Swedish climate activist Greta Thunberg joined a massive "Fridays for Future" demonstration in Hamburg attended by around 10,000 people AFP / MORRIS MAC MATZEN

Turmoil in the federal party, as Merkel's designated successor stepped down following a scandal over cooperation in an eastern region with the far right, had been "anything but a tailwind" in Hamburg, Ziemiak said.

The biggest winners in Sunday's vote marked by high turnout were the progressive, ecologist Greens.

They more than doubled their score to over 24 percent after climate change shot to the top of Germany's political agenda in 2019.

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

Hamburg goes to the polls on Sunday
Hamburg goes to the polls on Sunday AFP / ODD ANDERSEN

"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."

There was good news too for the centre-left Social Democrats (SPD), formerly the main challengers to the CDU for the chancellorship but recently overtaken by the Greens.

With just over 39 percent, incumbent SPD mayor Peter Tschentscher, 54, will likely remain in office as head of a "red-green" coalition in party bastion Hamburg.

Meanwhile far-right party AfD and the liberal Free Democrats (FDP) were both flirting with the five-percent hurdle needed to enter parliament.

The lead candidate for the centre-left SPD, Peter Tschentscher, is currently Hamburg's mayor
The lead candidate for the centre-left SPD, Peter Tschentscher, is currently Hamburg's mayor AFP / Patrik Stollarz

Early exit polls showed the far-right squeezed out, but updated totals from ARD and ZDF later Sunday pointed to AfD just clearing the threshold.

With the Greens on the rise and CDU and SPD support eroding, Hamburg's results reflect the broader political picture of fragmentation visible in Germany-wide polls.

But the prosperous port city with a proud left-of-centre tradition could yet be the first state to boot AfD out of parliament since its founding in 2013.

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

A "red-green" coalition of SPD and Greens has ruled Hamburg since 2011
A "red-green" coalition of SPD and Greens has ruled Hamburg since 2011 AFP / Patrik Stollarz

That has been enough to throw sand in the gears of regional politics, with national repercussions.

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

The breach of a historic political taboo provoked a nationwide backlash against both the 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 Monday how the party will select a new leader or leadership team.

Meanwhile the SPD can breathe easy after years of ever-grimmer federal and state election results that have seen nervous party members chew through multiple leaders.

While Hamburg's political makeup is unusual, events in the final week of campaigning showed that the port city is far from insulated from events in the rest of Germany and Europe.

On Friday, Swedish climate activist Greta Thunberg joined a massive "Fridays for Future" demonstration in Hamburg attended by around 10,000 people, according to police.

Weekly marches across the country by the school strike movement last year helped force Berlin to raise its climate ambitions and fix a binding end to coal power generation by 2038 in law.

Meanwhile, both the SPD and the Greens cancelled final campaign events on Thursday, after a racist gunman killed nine people with migrant backgrounds in the city of Hanau.

People from across the political spectrum have slammed AfD in the wake of the killings, highlighting similarities between its politicians' anti-migrant rhetoric and the words of the gunman in a rambling "manifesto" he is believed to have posted online.