Germans should be proud of the democracy they’ve built since 1949, as they behold the dramatic events unfolding in the otherwise sleepy regional capital of Erfurt, in the eastern state of Thuringia. Right-wing populists may grasp for power there as they do elsewhere in Europe and the world. But political culture in Germany, built upon the ruins of the Weimar Republic and the Third Reich, appears to be resolutely staring them down.

It was only Wednesday that a far-right populist party, the AfD, engineered a tactical coup in the Thuringian state parliament that could have, or so it hoped, normalized extremism in German politics. But within hours, Germany’s entire political mainstream stood up in defiance. Protesters took to the streets in Erfurt, Berlin and other cities. By Thursday, the coup was all but undone, and the country seems more united than ever against extremism.

The AfD’s parliamentary maneuver involved secretly switching its support in the third round of balloting, thereby toppling the incumbent premier and helping instead to elect the obscure candidate of another party, the liberal Free Democrats, which has the smallest contingent in the chamber. His name is Thomas Kemmerich. Whether or not he had had a hunch of the AfD’s scheme is unclear.

What is perfectly clear, however, is the national reaction. Leaders of the three parties on the left condemned the trick as “political arson.” So did the leaders of the conservative parties. Annegret Kramp-Karrenbauer, the boss of the Christian Democrats and a candidate to succeed Angela Merkel as chancellor, chastised her party’s Thuringian branch, which had also voted for Kemmerich, for acting against party policy. Her general secretary referred to parts of the AfD as “Nazis” on public TV. Merkel herself called the move “unforgivable.” Even leaders of the Free Democrats said that any political office that even implicitly relied on support from the AfD was unacceptable.

Kemmerich, a previously untested regional politician who had campaigned by flaunting his bald pate and cowboy boots, understood he had no hope of building and maintaining a governing majority. He also grasped that his path to power — with the AfD’s “perfidious trick,” as he called it — was never going to be considered legitimate. So, today, he offered his resignation. His own Free Democrats will table a motion to dissolve the Thuringian parliament and call for new elections.

How the Thuringians will vote remains to be seen. But it seems likely that they now realize that politics in their state, often considered a backwater, has national and even continental significance. They may feel a special call to responsibility.

What, though, does this episode say about German democracy as such? Its postwar constitution, drafted under the benevolent tutelage of the American conquerors-turned-protectors, was written to be a much stronger bulwark against extremism than the Weimar Republic’s was. But democracy needs not only the letter but also the spirit of liberal institutions. Hitler never formally abolished Weimar’s constitution, he just ignored it. The Caesers, Julius and Octavian, never got rid of elections, tribunes, senators or praetors, they just made them all irrelevant until Octavian became princeps, the unofficial “first,” better known as Emperor Augustus.

As democracies age, they seem to grow lazy about infusing the letter of their freedoms with the requisite spirit, as many Americans, Germans and others were reminded this week, when the U.S. Senate acquitted an impeached president without even admitting witnesses first. Technically, Kemmerich’s election by the Thuringian legislature was also perfectly legal. Members of parliament, in free and secret ballots, were simply casting their votes. And yet it immediately became clear that the AfD’s chicanery betrayed the soul of German democracy and mocked the will of the Thuringian electorate. As if they’d been training for 75 years, Germans instinctively started doing the right things.

Andreas Kluth is a member of Bloomberg’s editorial board.