A nationalist, anti-immigration party performed strongly in a German state election Sunday in the region where Chancellor Angela Merkel has her political base, overtaking her conservatives to take second place amid discontent with her migrant policies, projections indicated.

The three-year-old Alternative for Germany, or AfD, won 20.8 per cent of votes in the election for the state legislature in Mecklenburg-Western Pomerania. Merkel's Christian Democrats polled 19 per cent, their worst result yet in the state.

The centre-left Social Democrats, who led the outgoing state government, were the strongest party with about 30-per-cent support.

"This was a dark day for Merkel," Thomas Jaeger, a political scientist at Cologne University, told Reuters. "Everyone knows that she lost this election. Her district in parliament is there, she campaigned there, and refugees are her issue."

Economically weak Mecklenburg-Western Pomerania, in Germany's northeastern corner, is home to 1.6 million of the country's 80 million people and is a relative political lightweight. It is, however, the state where Merkel has her parliamentary constituency, and Sunday's regional vote was the first of five before a national election expected next September.

'The beginning of the end'

National AfD leader Frauke Petry celebrated "a blow to Angela Merkel." Local AfD leader Leif-Erik Holm told supporters: "Perhaps this is the beginning of the end of Angela Merkel's chancellorship today."

Merkel's refugee policies were a prominent issue in the campaign for Sunday's election, which came a year to the day after she decided to let in migrants who had travelled to Germany through Hungary — setting off the peak of last year's influx. Germany registered more than one million people as asylum-seekers last year.

GERMANY-ELECTION/

Alexander Gauland and Beatrix von Storch of the AfD party smile before first exit polls during the Mecklenburg-Vorpommern state election at the party's post-election venue in Schwerin. (Hannibal Hanschke/Reuters)

New arrivals in Germany have slowed drastically this year, policies have been tightened and Mecklenburg is home to few foreigners. Still, New Year's Eve robberies and sexual assaults in Germany blamed largely on foreigners, as well as two attacks in July carried out by asylum-seekers and claimed by ISIS, have fed tensions.​

Merkel has stuck to her insistence that "we will manage" the refugee crisis, and has also said that "sometimes you have to endure such controversies."

"This result, and the strong performance of AfD, is bitter for many, for everyone in our party," said Peter Tauber, her Christian Democrats' general secretary.

He said the state government's positive record took a back seat for many voters, "because among a recognizable part, there was an explicit wish to voice displeasure and protest, and we saw that particularly strongly in the discussion about refugees."

EUROPE-MIGRANTS/GERMANY

A refugee takes a selfie with German Chancellor Angela Merkel outside a refugee camp near the Federal Office for Migration and Refugees after registration at Berlin's Spandau district on Sept. 10, 2015. Merkel's refugee policies were a prominent issue in the campaign for Sunday's election. (Fabrizo Bensch/Reuters)

GERMANY-ASSAULTS/

Supporters of an anti-immigration movement take part in in demonstration rally in reaction to mass assaults on women on New Year's Eve, in Cologne, Germany, Jan. 9, 2016. Germany's refugees policies have sparked a political backlash for Chancellor Merkel. (Wolfgang Rattay/Reuters)

Sunday's result could make it more difficult for Merkel to bury a festering dispute with the Christian Social Union, the Bavarian arm of her conservative bloc, which has long criticized her decision to open the borders and advocated an annual cap on migrants.

CSU general secretary Andreas Scheuer said that "we feel vindicated in our course."

Will Merkel seek 4th term?

Merkel has yet to say whether she will seek a fourth term next year, as is widely expected. While polls this year have shown her popularity slipping from stellar to merely solid, there is no obvious conservative alternative and her bloc is ahead nationally.

"She is, in people's perception, personally responsible for the border opening, and she has to deal with that," political science professor Karl-Rudolf Korte told ZDF television. "But she can deal with it — she has a year."​

Mecklenburg was the only one of Germany's 16 states where the far-right National Democratic Party was represented in a state legislature, but it appeared to have lost its seats on Sunday. Its support dropped below the five per cent needed to keep them, with many supporters apparently switching to AfD.

The state has been run for the past decade by the parties that currently run Germany. Popular Social Democratic governor Erwin Sellering has governed with Merkel's party as his junior partner. Both parties lost support compared with the last state election in 2011, when they polled 35.6 and 23 per cent, respectively.

The opposition Left Party — once popular with protest voters — also lost support, slipping about six points to 12.5 per cent. The left-leaning Greens were hovering around the five-per-cent mark.

GERMANY-ELECTION/

A man with a tie in German national colours wears a pin of the anti-immigrant Alternative for Deutschland party during the state election Mecklenburg-Vorpommern. The party has been making gains nationwide on anti-refugee sentiment. (Stefanie Loos/Reuters)

AfD is now represented in nine of Germany's 16 state legislatures and hopes to enter the national parliament next year. Still, it fell well short Sunday of its aim of becoming the strongest party in Mecklenburg, and also didn't match the 24.3-per-cent support it won in another eastern state, Saxony-Anhalt, in March.

There's no realistic prospect at present of AfD going into government. Other parties won't deal with it.

The next regional election is Sept. 18 in Berlin, where local issues are likely to play a stronger role.

With files from Reuters