BERLIN - German Chancellor Angela Merkel's party suffered a bruising loss in Berlin state elections Sunday while the right-wing populist AfD again gained support, capitalising on anger over her open-door refugee policy.

The anti-Islam Alternative for Germany party won around 12 percent, according to broadcasters' exit polls in the capital, which prides itself on being a hip, multicultural city -- gaining seats in the tenth of Germany's 16 states a year ahead of national elections.

Merkel's Christian Democratic Union won just 18 percent -- its worst post-war result in the city, before or after the 1989 fall of the Berlin Wall -- according to the exit polls, likely spelling the end of its term as junior coalition partner to the Social Democrats, who won 23 percent.

The election in the chronically indebted city-state of 3.5 million people was dominated by many local issues including poor public services, crumbling schools, late trains and a housing shortage, as well as how to cope with the migrant influx.

Nonetheless, the vote marked another milestone for the upstart AfD, which has campaigned on a xenophobic platform, similar to France's National Front or far-right populists in Austria and the Netherlands, and gained support especially in Berlin's poor eastern fringe districts. A strong showing in Germany's biggest city means it "doesn't just benefit from discontent in rural areas but can establish itself ... in a city of millions that is known for its open lifestyle," said the Frankfurter Allgemeine Sonntagszeitung newspaper.

Germany took in one million asylum seekers last year, and over 70,000 of them came to Berlin, with many housed in the cavernous hangars of the Nazi-built former Tempelhof airport, once the hub for the Cold War-era Berlin airlift.

Merkel -- who was booed this week by right-wing activists shouting "get lost" -- before the election conceded it was hard to reach the "protest voters" who have turned their backs on mainstream parties.

Berlin's SPD Mayor Michael Mueller dramatically warned on the eve of the election that a strong AfD result would be "seen throughout the world as a sign of the resurgence of the right and of Nazis in Germany".

Merkel's CDU has a national majority -- but in Berlin it has served as junior coalition partner to Mueller's SPD, traditionally the strongest party in the city.

As Mueller has rejected a new coalition with the CDU, Merkel's party may be cast out of the Berlin government altogether.

The SPD was seen likely to team up with the ecologist Greens and the far-left Die Linke party, both of whom scored more than 16 percent support, according to ARD and ZDF exit polls.

Such a "red-red-green" coalition, its member hope, could one day be replicated at the national level.

Merkel meanwhile will face further pressure "to explain her political strategy", said Gero Neugebauer of Berlin's Free University.

"The more fearful within her party might be increasingly scared of losing power in 2017," he told the Handelsblatt business daily.

Another analyst, Kai Arzheimer of Mainz University, also predicted tensions would rise between the CDU and its Bavarian sister party the CSU, but he stressed the CDU was unlikely to change its top candidate, Merkel."To ask this question one year before federal elections would be suicidal, especially since in the CDU there is no credible successor," he said.

In Berlin -- a city famously dubbed "poor but sexy" by its previous mayor, bon vivant Klaus Wowereit -- the election campaign was dominated not just by migrant policies but also widespread frustration over poor public services.

With little industry and an above-national average jobless rate of 10 percent, Europe's techno party capital is chronically broke and known for its shambolic city offices.

Often seen as an amusingly chaotic exception in otherwise orderly and punctual Germany, Berlin became a national laughing stock for a grand BER airport project that is now five years behind schedule and three times over budget.

In another debacle, thousands of refugees were left waiting for days and weeks last year at Berlin's then hopelessly overwhelmed Lageso central migrant registration centre, with many forced to sleep in the dirt outside.

Casting his ballot on Sunday, police officer Tobias Ludley, 27, said he worried about Berlin's cash-strapped public services, as well as its "little building site", the BER.

He also voiced concern about the AfD, a party he labelled "the wolf in sheep's clothing".

"The AfD is appealing to people who otherwise wouldn't vote, the protest voters," he said, worried about the party gaining ground in a city which was normally "a shining example of multiculturalism".