Merkel’s Christian Democrats (CDU) were beaten into third place by the anti-immigrant, anti-Islam Alternative for Germany (AfD) in the north-eastern state of Mecklenburg-Vorpommern by taking 20.8 percent of the vote.

Why join?

The CDU fell from 23 percent to 19 percent in their worst result in the state.

Both came in behind the Social Democrats (SPD), the region’s dominant political group, which received 30 percent of the votes, falling from 35 percent in 2011.

The neo-nazi NPD was driven from the regional assembly, its support dropping below the 5 percent threshold.

The election was dominated by the refugee issue, a year after Merkel's decision to let in asylum seekers making their way across Europe.

“This is a slap in the face for Merkel – not only in Berlin but also in her home state,” said Frauke Petry, joint-leader of the AfD.

“The voters made a clear statement against Merkel's disastrous immigration policies. This put her in her place.”

“We are writing history in Mecklenburg-Vorpommern,” Leif-Erik Holm, the AfD’s lead candidate in the state said. “Perhaps today is the beginning of the end of the chancellorship of Angela Merkel.”

AfD, founded in 2013, won 24 percent of the vote in Sachen Anhalt region in March, and is now represented in nine of Germany’s 16 regions. It is now gearing up for regional elections in Berlin in two weeks time.

It is particularly doing well in eastern German regions, which are generally poorer, more sceptical of mainstream parties and more critical of immigration, although Mecklenburg-Vorpommern has taken in only around 25,000 asylum seekers out of the million that arrived to the country last year.

However, AfD will not take power in the region, as other parties refuse to co-operate with it, the SPD is expected to maintain its coalition with the CDU.

Wake-up call?

Sunday’s election is also seen as a test for next year’s general election, as protesting voters are leaving the mainstream parties to vote for AfD.

Merkel’s support has sunk to a five-year low recently to 45 percent, down from 67 percent a year ago.

The AfD is polling at 12 percent on national level and it is expected to be the first far-right party to enter the Bundestag since 1945.

Peter Tauber, CDU general secretary, blamed the result on widespread “discontent and protest” at Merkel’s refugee policy.

Social Democrat leader Sigmar Gabriel said Germany's main political parties “must ask themselves how we can stop people from choosing the AfD”.

"The key is that we must bring about more security, not just domestic security or protection from crime and terrorism, but also social security," he said after the vote according to AFP.

Merkel has not yet announced if she will run for a fourth term in office next autumn due to pressure from the sister party of her CDU, the Bavarian CSU, according to Der Spiegel magazine.

Bavarian finance minister Markus Soeder said the results should serve as a "wake-up call" for Merkel on her refugee policy.

He told a regional newspaper that Merkel needed to adopt a hard line on migrants.

"It is no longer possible to ignore people's views on this issue. Berlin needs to change tack," he said.

The defeat comes at a crucial time for Merkel, as she needs to deal with the UK’s decision to leave the European Union, a fragile migration deal with Turkey, and an increasingly assertive Russia at Europe’s doorstep.

AfD’s win was hailed by French far-right leader Marine Le Pen, who tweeted: “What was impossible yesterday has become possible: the patriots of AfD sweep up the party of Ms Merkel. All my congratulations!”

Most UK voters in a YouGov survey said they would remain part of the European Union should a second referendum be held now. The poll follows reports the EU is willing to make a concession on British exit demands.