President Trump’s refusal to acknowledge a clear and decisive electoral defeat in 2020 and his continuing efforts to block certification of the obvious results amount to, in the words of The Washington Post’s Editorial Board, an attempted “coup.”

His efforts to deny the reality of defeat and threaten democracy recall the most famous comparable episode in modern European history — the claims by the German military and diplomatic establishment that Germany had not been defeated militarily in World War I. Instead, they argued, Germany had been “stabbed in the back” by liberals, socialists, communists and Jews who somehow snatched defeat from the jaws of victory.

This falsehood — in German, it had the name Dolchstosslegende — did not begin with Adolf Hitler, but he and the Nazis made good use of it when they attacked the leaders of the Weimar Republic as “November criminals” because they signed the armistice with the victorious Allies in the fall of 1918.

The Dolchstosslegende played a significant role in the destruction of the first German democracy. Today, as Trump and, even more perniciously, Republican officials and voices in the conservative media amplify the lie that Trump’s rightful victory was “stolen” from him, we should revisit the roots of the German denial of the country’s defeat at the end of World War I to understand just how dangerous Trump’s actions are in this moment.

A consensus of historians agree that Imperial Germany bore responsibility for escalating a conflict in the Balkans into a Europe-wide war. Rather than the quick victory anticipated by German generals, the fight on the Western Front became a stalemate of trench warfare. In the battles of Verdun and the Somme in 1916 alone, the German army endured catastrophic losses of over 700,000 soldiers. That year, a coalition of liberals, social democrats and the Catholic Center Party emerged in the German parliament, the Reichstag, to urge Kaiser Wilhelm II and the military leadership of Gens. Paul von Hindenburg and Erich Ludendorff to negotiate a compromise peace. They urged leaders to reject calls for unlimited submarine warfare in the Atlantic Ocean and to abandon plans for further offensives on Germany’s Western Front.

But Wilhelm and the military leaders rejected their pleas. Instead, they unleashed the German submarine fleet on merchant shipping in the Atlantic, prompting the United States to intervene in the European war. In 1917, Germany’s military triumphs and diplomatic strategy led to victory on the Eastern Front, capped by the decision of the Bolshevik regime to leave the war and accept the humiliating terms of the Treaty of Brest-Litovsk on March 3, 1918. Flush with that victory, Germany brought thousands of troops to the Western Front with the intention of winning decisive battles and forcing the Allies to accept a peace or surrender on German terms.

In March 1918, 230,000 German soldiers were killed in a two-week offensive that Hindenburg and Ludendorff had ordered on the Western Front. Three further offensives from March to July also failed to gain the desired objective, with the loss of 750,000 German soldiers, of whom 350,000 were missing or taken prisoner. Allied aviation, the invention of the tank and the arrival each month that spring and summer of 100,000 U.S. troops facilitated allied counteroffensives that led to a slow advance to the German border.

For the first time since Germany invaded Belgium and France in 1914, the prospect loomed that the devastation of World War I, which in the West had largely taken place in France and Belgium, would soon come to Germany itself. Yet, despite this unfolding catastrophe, the hard core of the German army in France did not break. There was no stab in the back. The war was being lost because of the superiority of the Allied military and the refusal of the German leadership to accept a compromise peace in 1916 or the following year.

At the end of September 1918, Ludendorff realized that the war was lost and that its continuation would serve only to bring it home to Germany itself. He and Hindenburg pushed for the establishment of a parliamentary government. Ludendorff’s call for a “revolution from above,” though, did not stem from an epiphany about the virtues of democracy. Rather, he wanted those civilian leaders to bear the consequences of the war that the Kaiser and the military leadership had unleashed, escalated and refused to settle with an earlier compromise peace. The future leaders of Germany’s first democracy would become his scapegoats — figures who could be blamed for the disaster he, Hindenburg and others had wrought.

Speaking to the military high command on Oct. 1, 1918, Ludendorff said: “I have asked His Majesty [the Kaiser] to bring those opposed who are largely responsible for things having turned out as they have into the government. We shall, therefore, see that these gentlemen enter the [government] ministries. They must now make the peace which has to be made. They must now have the soup which they have served us!”

Ludendorff’s mendacious and cynical statement to his fellow officers was one origin of the stab-in-the-back legend, and it came from the very top of the German military leadership. The fact that the German army remained in trenches in France when the truce was finally announced in November nourished the illusions of soldiers — including Hitler and other early members of the Nazi Party — that the war had not, in fact, been lost on the battlefield.

It was after the war was lost and in reaction to the catastrophe it had become that the German people launched the revolution of November 1918. It brought an end to the German monarchy and opened the path to introducing the first unequivocally democratic government in German history. Yet the stab-in-the-back legend was the parting shot of the authoritarian regime that sought to shift blame for the lost war from those who had waged it onto liberals, social democrats, radical leftists and, of course, Germany’s very small Jewish community.

In accord with its origins in the German military high command in World War I, the stab-in-the-back legend struck a chord in large parts of the German military and diplomatic establishment, in veterans groups and in right-wing organizations and political parties in the Weimar Republic, most importantly in the Nazi Party beginning in 1920.

The lie that German democracy, not the earlier authoritarian regime, was responsible for the disaster of World War I figured prominently in the right-wing propaganda assault on the Weimar Republic. It contributed to the decision by leaders of the German conservative establishment to invite Hitler into power in January 1933.

Many people, including prominent figures such as Hindenburg and Ludendorff, who knew it was an obvious falsehood, repeated it and lent it their prestige and status. These actors associated the new democracy, not the old authoritarian order, with defeat and humiliation, when in reality it was German democrats who recognized the value of peace and bringing an end to the senseless slaughter of the war and who understood that the only alternative to accepting the armistice was continued war and an Allied invasion of Germany.

Hitler, in this and many other aspects, was not an original thinker. He learned much of his politics in this atmosphere of bitterness and rage in the postwar German military. In his Munich speeches after the war, he referred to these scapegoats as “the November criminals.” From its origins, the stab-in-the-back legend was never only an expression of disagreement. Rather, it was always designed to exclude the opposition from the body politic; the opponents were “criminals” and “traitors.”

The Dolchstosslegende was a preposterous falsehood, yet millions came to believe it, and in becoming accustomed to that lie, many of those same millions came to accept the even more preposterous lie that there was an international Jewish conspiracy intended to exterminate “the Aryan race.” Belief in one bad lie nourished the inclination to believe another, even more dangerous one.

The refusal to accept defeat, and instead to point at scapegoats, voice conspiracy theories and avoid responsibility, indicates that the spirit of Erich Ludendorff is alive and well in Trump and the Republican Party. That spirit undermined democracy then and does so today.