With almost all of the votes counted, results show Merkel’s Christian Democrats overtaken by AfD in regional poll.
A year after German Chancellor Angela Merkel’s decision to open the country’s borders to refugees, an anti-immigrant party has made huge gains in a state election, according to official results.
With most of Sunday’s ballots counted, Alternative for Germany (AfD) received about 21 percent of votes in the eastern Mecklenburg-Vorpommern region, beating Merkel’s party to take second place.
Merkel’s conservative Christian Democrats came third with 19 percent, the party’s worst result yet in the state that includes the chancellor’s own electoral district.
The centre-left Social Democrats gained the support of 30 percent of voters.
Frauke Petry, the head of AfD, said her party’s success in the state election was a result of Merkel’s "catastrophic migration policies", according to the DPA news agency.
WATCH: Europe’s refugees - An economic opportunity?
Sunday’s election was the first of five regional polls ahead of a national election expected in just over a year.
"The repercussions of this result will resonate across Germany because we know that within 12 months there will be a general election," said Al Jazeera’s Dominic Kane, reporting from Schwerin, the capital of Mecklenburg-Vorpommern region.
Kane said that the AfD had grown from a party that just a few years ago was struggling to get above the 5 percent threshold required in order be represented in any parliament in Germany - state or federal - to a political force that was persuading one in five voters in the area.
"So the question will be: will the government listen to this?" Kane said.
"The fact is that the government in this state was a mirror image of the government federally, of the Social Democrats and Christian Democrats in coalition, and both parties until this point have maintained the fact that the refugee policy is the right one."
In the sprawling farming and coastal state of Mecklenburg-Vorpommern - Germany’s poorest and least populous - the issue of refugees and integration had become the deciding factor for one in three voters.
"I am voting AfD. The main reason is the question over asylum-seekers," a pensioner and former teacher who declined to be named told AFP news agency.
"A million refugees have come here. There is money for them, but no money to bring pensions in the east to the same levels as those of the west," he said, referring to the lower retirement payments that residents of former Communist states receive compared to those in the west.
Petry, the AfD leader, released a video on Friday urging voters to "make history not only in the state-region, but the whole of Germany" by backing the party massively in the polls.
Erlier this week, Merkel urged voters to reject AfD, which she said in an interview had "no solution for problems and which are built mainly around a protest - often with hate".
In January, Germany’s interior ministry said that 1.1 million asylum seekers and migrants had entered Europe’s biggest economy in 2015 after fleeing war and poverty in their home countries.
Then, late last month, the head of Germany’s Federal Office for Migration and Refugees told a German newspaper that the country took in fewer migrants in 2015 than previously thought, because some were registered twice and others had moved on to other destinations.
"We’ll present the exact number soon but it’s certain that less than one million people came to Germany last year," Frank-Juergen Weise told Bild am Sonntag newspaper.