The Danish liberal and national movements gained significant momentum in the 1830s, leading to a transformative period in Danish history. In the wake of the European revolutions of 1848, Denmark transitioned from an absolute monarchy to a constitutional monarchy on June 5, 1849. This change was driven by the demands of the growing bourgeoisie, who sought a more significant role in governance. To avoid the kind of violent revolution that was occurring elsewhere in Europe, King Frederick VII conceded to these demands, resulting in a new constitution that introduced significant reforms.
The 1849 constitution established Denmark as a constitutional monarchy, with powers now separated across different branches of government. The king remained as the head of the executive branch, while legislative power was shared between two parliamentary chambers: the Folketing, elected by the general population, and the Landsting, elected primarily by landowners. The constitution also granted adult males the right to vote, along with freedoms of the press, religion, and association, and created an independent judiciary.
One of the notable outcomes of this period was the abolition of slavery in the Danish West Indies, Denmark's Caribbean colony, which had previously hosted some of the largest slave auctions in the world. Additionally, Denmark sold its tropical colony of Tranquebar in India to Britain in 1845.
At this time, the Danish king’s realm consisted of the islands, the northern half of the Jutland peninsula, and the Duchies of Schleswig and Holstein, which were in a personal union with the kingdom. The Duchy of Schleswig was a Danish fief, while Holstein remained part of the German Confederation. Many Danes increasingly saw the duchies as integral to a unified Danish state, but this view was at odds with the German-speaking majority in Schleswig and Holstein, who, inspired by liberal and nationalist movements, sought independence from Denmark in a movement known as Schleswig-Holsteinism.
Tensions escalated with the outbreak of the First Schleswig War (1848–1851), following Denmark's constitutional changes in 1849. The conflict ended with a return to the status quo, largely due to the intervention of Britain and other Great Powers, but it left unresolved tensions between the Danish and German populations in the duchies.
Debate over the future of Schleswig-Holstein intensified within Denmark. National-Liberals advocated for the permanent incorporation of Schleswig into Denmark, while allowing Holstein to pursue its own path. However, these plans were overtaken by broader European events, leading to the outbreak of the Second Schleswig War in 1864, pitting Denmark against both Prussia and Austria. The war lasted from February to October 1864, and Denmark, unable to match the military might of the two German powers, was decisively defeated. As a result, Denmark was forced to cede both Schleswig and Holstein to Prussia and Austria.
The loss of Schleswig-Holstein was a devastating blow to Denmark and marked the culmination of a long series of territorial losses that had started in the 17th century. With this defeat, Denmark lost some of the richest parts of its kingdom, further compounding earlier losses such as the territories of Skåne to Sweden. The Second Schleswig War forced Denmark to confront its diminished status, leading to a period of intense national reflection and the emergence of a new form of nationalism.
In the wake of the war, Denmark turned inward, focusing on the development of its remaining, poorer territories, particularly Jutland. Extensive agricultural reforms and improvements took place, and a new sense of nationalism emerged, emphasizing the values of rural life, modesty, and decency. This "small-state" nationalism marked a shift away from the ambitions of a once-great kingdom, as Denmark sought to rebuild and redefine itself as a smaller, more cohesive nation.