Succession crisis
Frederick was married three times, but he produced no legitimate issue. The fact that he reached middle age without producing an heir meant that his second cousin Prince Christian of Glücksburg (1818–1906), the paternal descendant of Christian III, was chosen as his heir-presumptive in 1852. When Frederick died in 1863, Christian took the throne as Christian IX.
Nationalism in the German-speaking parts of Schleswig-Holstein meant that there was no consensus to keep the duchies united under the Danish crown, internationally or within the duchies themselves. The duchies were inherited according to Salic law among the descendants of a past heiress, Hedvig of Holstein, whose heir according to primogeniture after King Frederick VII was Frederick, Duke of Augustenburg (who proclaimed himself Duke of Schleswig-Holstein after Frederick VII's death). This Frederick of Augustenburg had become the symbol of the nationalist German independence movement in Schleswig-Holstein since the time that his father, in exchange for compensation, had renounced his claims as first in line to inherit the twin Duchies of Schleswig and Holstein following the London Protocol of 8 May 1852, which concluded the First War of Schleswig. Because of his father's renunciation, Frederick was regarded as ineligible to succeed.
Denmark was (up until 1953) also under Salic Law, but only among descendants of Frederick III (who was the first hereditary monarch of Denmark; previously the kingdom had been, officially, elective). But Frederick VII was the last of Frederick III's male line, therefore, his nearest kinsmen in the male-line, the Schleswig-Holstein ducal lines of Augustenborg and Glücksburg (cadet branches of Denmark's earlier, non-hereditary kings), were not entitled to succeed to Denmark's throne, although they retained hereditary claims to the duchies of Schleswig and Holstein. Upon Frederick VII's death, Denmark's throne could devolve to or through a female heir according to "semi-Salic" succession. There were, however, conflicting interpretations of that provision and of Denmark's claim to its applicability to the duchies of Schleswig and Holstein, held theretofore in personal union by the kings of Denmark. The question was solved by an election and a separate law to confirm Denmark's new successor.
The closest female relatives of Frederick VII were the issue of his paternal aunt, Princess Louise Charlotte of Denmark, who had married a cadet Hessian prince. However, they were not male-line descendants of Helwig of Schauenburg, and thus were not eligible to succeed in Holstein, and had disputed claims on Schleswig. The semi-Salic heiresses of Frederick VII were Princess Caroline of Denmark and Frederick VII's divorced wife Vilhelmine (both childless daughters of the late King Frederick VI). They were followed in the line of succession by Princess Louise Auguste of Denmark, sister of Frederick VI, who had married Frederick, Duke of Augustenburg, Salic heir to Schleswig and Holstein after Frederick VII, but whose wife's claim to Denmark would only come into effect after the deaths of Caroline and Vilhelmine, both still living in 1863.
Some rights also belonged to the Glücksburg line, a more junior branch of the royal clan. They were also semi-Salic heirs of Frederick III through a daughter of Frederick V of Denmark's, and they were more junior agnatic heirs eligible to succeed in Schleswig-Holstein. These dynasts were Christian of Glücksburg (1818–1906) and his two elder brothers, the younger of whom had sons and daughters.
Prince Christian of Glücksburg (1818–1906) had been a foster grandson of the sonless royal couple Frederick VI and Queen Marie Sophie, and he thus was well known at the royal court. Prince Christian was a nephew of Queen Marie Sophie's and descended from a first cousin of Frederick VI. He was brought up as a Dane, having lived in Danish-speaking lands of the royal dynasty, and he never bore arms for German interests against Denmark, as had other princes of the House of Glücksburg and the House of Augustenburg. This made him a relatively attractive royal candidate from the Danish viewpoint since, as a descendant of Frederick III, he was eligible to succeed in Denmark, although not first in line. He was also, but separately, eligible to inherit the dual duchies, but was not first in line either. Christian of Glücksburg also had married Princess Louise of Hesse-Kassel, second-eldest daughter of the closest female relative of Frederick VII's. Louise's mother and brothers, princes of Hesse in Germany, renounced their rights in favor of Louise and her husband. Prince Christian's wife thereby became the closest female heiress of Frederick VII's. The thorny question of the application of semi-Salic provision in the succession of Denmark was at that point resolved by legislation, through which Prince Christian of Glücksburg was chosen in 1852 to succeed Frederick VII in Denmark.
Frederick VII died in Glücksburg in 1863 following an attack of erysipelas and was interred in Roskilde Cathedral. Christian took the throne as Christian IX.
In November 1863, Frederick of Augustenborg claimed the twin-duchies in succession to Frederick VII of Denmark, who also was the last king of Denmark who, by primogeniture, was also sovereign Duke of Schleswig and Holstein, but whose death extinguished the patriline of Denmark's hereditary Oldenburg kings. The resulting divergence of hereditary claims to the duchies eventually developed into the Second War of Schleswig.