BERLIN — German Chancellor Angela Merkel's party and the far right backed the same candidate for state premier in the eastern region of Thuringia on Wednesday, a taboo-breaking move that sent shock waves through German politics.

Thomas Kemmerich from the liberal Free Democratic Party was elected as head of the state parliament with backing from members of Merkel’s Christian Democrats and the populist Alternative for Germany (AfD). Mainstream parties have ruled out any form of political cooperation with the AfD.

Hundreds of Germans took to the streets to show their discomfort in spontaneous protests, from the regional capital in Erfurt to the larger cities of Berlin and Cologne.

“It is a new low point in Germany's postwar history,” said Lars Klingbeil, secretary general of Merkel’s main federal coalition partner, the Social Democrats.

Marking the first time the AfD has played the role of political kingmaker, the vote raised questions as to whether the right-wing party, which has surged in popularity in recent years with a nationalist and anti-immigration message, has become an unavoidable force in German politics.

The election also set the ground for a clash between federal parties — who maintain that the right-wing AfD should be boycotted — and local branches, which have been known to take a more pragmatic stance. The federal leadership of the Christian Democrats was quick to rebuke the actions of its state-level parliamentarians on Wednesday.

“Today is a black day for Thuringia,” said Paul Ziemiak, the party’s secretary general. “The CDU has made it clear again and again that it will not work together with the AfD. That stands in fundamental contradiction with Christian Democratic values.”

He called for new elections. Party chairwoman Annegret Kramp-Karrenbauer said the local branch had expressly broken the wishes and guidelines of the party’s federal leadership.

Incumbent Bodo Ramelow, from the left-wing party Die Linke, had been widely expected to be reelected in Wednesday’s election but was beaten by a single vote. Kemmerich’s FDP holds just five seats in the parliament.

The local head of the Christian Democrats, Mike Mohring, said his party was not responsible for the way other parties had voted in the secret ballot and said it was important that Kemmerich did not allow the AfD to form part of the governing coalition.

It’s likely there won’t be a coalition at all, said Hajo Funke, a political science professor with the Free University in Berlin. He called the day’s events a “breach of taboo” but said that given the decisive stance of the heads of the major parties it is “an ad­ven­ture that will presumably end in new elections.”

The Thuringia branch of the AfD is known for being particularly hard-line. Its local head, Björn Höcke, has survived calls from within the party itself to oust him over his ties to far-right extremists. AfD politicians said Wednesday’s vote showed that their political presence was impossible to avoid.

“Liberal-conservative majorities only exist with the AfD,” tweeted Tino Chrupalla, an AfD lawmaker, following the vote.