Where Ms. Merkel, the chancellor, has welcomed refugees, Ms. Petry, a rising far-right leader, has said border guards might need to turn guns on anyone crossing a frontier illegally.
Where Ms. Merkel has urged tolerance, Ms. Petry has embraced the angry populism now running through Europe and the United States.
“The preachers of hatred” was how the news weekly Der Spiegel characterized the new German right on its cover last month, emblazoned with a portrait of the petite Ms. Petry.
But this brisk, garrulous 40-year-old is more than Ms. Merkel’s foil. She is a disruptive, new force on the German political scene.
She and her party, the Alternative for Germany, have ridden a wave of discontent over the chancellor’s embrace of more than one million refugees to their strongest poll ratings ever.
They are now roiling Germany’s placid, consensus-driven politics and threatening to alter its political landscape as insurgent parties have done in less stable or prosperous countries around Europe.
Not unlike Donald J. Trump in the United States, she is also breaking open a political dialogue and liberating a new and impolitic — critics say racist — language in the mainstream.
“The power of the established parties is crumbling,” a jubilant Ms. Petry told supporters after her party took 13.2 percent of the vote in normally sleepy local elections in the central state of Hesse last Sunday.
This Sunday is another test, with elections in three larger and more important states — one in the east and two in the west — that are being closely watched as a referendum on the chancellor’s refugee policies and a bellwether for the nation.
In the east, support for the Alternative for Germany now nears 20 percent — about double that in the west.
But even in the west, the far-right rebellion is chipping away at the chancellor’s conservative Christian Democrats, as well as its Social Democratic coalition partners, in a country where the Nazi past looms large. Read More: