LONDON — Britain’s shambolic efforts to leave the European Union have sometimes been likened to the Suez crisis in 1956, when a botched military intervention in Egypt underscored the limitations of post-imperial British power.

But in parts of Europe a different Brexit comparison is being made, and it is no more flattering.

In 1864, riding a wave of nationalism, another former colonial power, Denmark, became engulfed in a doomed military conflict against Prussian and Austrian forces, experiencing a crushing loss that led to the surrender of around a third of its territory.

Defeat brought the realization that Denmark was smaller and less powerful and had fewer allies than it had assumed, delivering a shattering blow to the national psyche.