BOTTROP, Germany — Guido Reil is a coal miner, like his father and grandfather before him. He joined a trade union at 18 and the center-left Social Democratic Party at 20. Fast-talking and loud, he has been an elected union representative for over a decade.

But two years ago, after the arrival of hundreds of thousands of refugees in Germany, Mr. Reil switched to the far-right Alternative for Germany party, or AfD. Competing in state legislative elections last May, the party won 20 percent of the vote in his home district with his name on its list — and the Social Democrats slipped 16 percentage points from a previous election.

“Those are my former comrades,” Mr. Reil said, chuckling. “They came with me.”

How is a far-right party drawing voters from labor, a traditional bastion of the left? The question is not academic, but goes directly to the heart of the emerging threat the AfD presents to Germany’s political establishment, including Chancellor Angela Merkel.

The AfD shocked Germany in the fall when it became the first far-right party to enter Parliament since World War II. But that breakthrough not only shattered a significant postwar taboo. It has also enormously complicated the task of forming a new governing coalition, leaving Germany and all of Europe in months of limbo.