The far-right Alternative to Germany (AfD) party rose in elections in two eastern states, preliminary results show.
The center-right Christian Democrats of Chancellor Angela Merkel (CDU) remain the largest party in Saxony, but with a smaller share of the vote.
In Brandenburg, the African Party was expected to end behind the center-left Social Democratic Party (SPD).
The failures of the ruling parties were not as great as they feared.
The African Party has taken advantage of the discontent with Germany's Refugee Policies and the planned closure of coal mines in the former communist countries.
- How far to the right is Africa?
- Angela Merkel's Quiet Power
In Saxony, the CDU saw its share of the vote drop by 7.4 points in the 201
In Brandenburg, bypassing Berlin, the SPD – which governed the state after the unification of Germany in 1990 – won 27.2% of the AfD vote of 22.9%, preliminary figures showed.
"We are pleased in both Brandenburg and Saxony," said AfD co-chair Alexander Holland, adding that his party had "punished" Ms Merkel's conservatives.
But despite the gains, the result may disappoint the African Party, as the party hoped to win the most votes in Brandenburg, according to Dalyan McGuinness, BBC of Berlin
The numbers will be met with relief by both the CDU and the CDU. SPD, partners in the national government of Ms Merkel, our correspondent
The coalition must continue until the federal elections of 2021 and the collapse could trigger early elections or lead to a minority government.
Ms Merkel herself plans to retire as chancellor in 2021, having already resigned as CDU leader late last year.