German Chancellor Angela Merkel's Christian Democratic Party (CDU) has lost its position as second-strongest party in Mecklenburg-Vorpommern to the anti-immigration Alternative for Germany (AfD), according to official preliminary results.
The AfD won 20.8 per cent, meaning it will enter the north-eastern state's parliament for the first time. It already has deputies in eight other state legislatures and is likely to enter the national parliament after next year's general election.
The CDU came in with 19 per cent of the vote in the north-eastern state's election, which was widely understood as a fresh test of Merkel's controversial policies during the refugee crisis.
The centre-left Social Democratic Party (SPD), which currently heads a grand coalition with the CDU as its junior partner, remained the strongest party at 30.6 per cent.
Voter turnout was 61.6 per cent, an increase of more than 10 percentage points over 2011.
The result means that, despite losses for both governing parties, the SPD and the CDU will be able to form a coalition for another five-year term. However, Social Democrat premier Erwin Sellering did not confirm Sunday whether he would seek another coalition with CDU.
AfD leader Frauke Petry said her party's success in Mecklenburg-Vorpommern - home to Merkel's constituency of Stralsund - was a result of the chancellor's "catastrophic migration policies," adding: "We have put the CDU in its place."
Peter Tauber, the CDU's general secretary, said the "bitter" loss for his party had occurred because of widespread "dissatisfaction and protest" over Merkel's decision to keep German borders open to refugees.
The results also pointed to the fact that the AfD had eaten into the vote share of parties from across the political spectrum, and that 34 per cent of its supporters in the state had not voted in the previous election in 2011.
Public support for Merkel plummeted in the wake of two terrorist attacks in July that were carried out by asylum seekers and claimed by Islamic State.
Critics of her decision to keep Germany's borders open, which resulted in the arrival of 1.1 million migrants in 2015, say she is to blame for creating a security threat in the country.
According to a survey conducted before the election by polling firm Infratest Dimap, more than a third of voters in Mecklenburg-Vorpommern said the refugee influx would be the key factor in their decision on election day.