During the Third Northern War (1700–1721), Denmark-Norway made another attempt to recover its lost provinces from Sweden. However, this effort initially resulted in the unfavorable Peace of Travendal in 1700. When Denmark re-entered the conflict as part of a larger alliance, Sweden was eventually defeated. Despite this decisive shift in the balance of power, Denmark's hopes of reclaiming its former territories were dashed. The great European powers, wary of one nation controlling both coasts of the Sound, opposed any territorial gains for Denmark. As a result, the Treaty of Frederiksborg in 1720 did not return the eastern provinces to Denmark and even required the Danes to return Swedish Pomerania, which they had held since 1715. From this point onward, Denmark's ambitions to recover its lost lands from Sweden were permanently thwarted.
For much of the 18th century, Denmark enjoyed a period of relative peace. The only significant threat came in 1762 when the Duke of Holstein-Gottorp ascended to the Russian throne as Tsar Peter III and declared war on Denmark over his ancestral claims to Schleswig. However, before any conflict could occur, Peter III was overthrown by his wife, who became Tsarina Catherine II (Catherine the Great). Empress Catherine abandoned her husband’s claims and negotiated the transfer of the duchy of Schleswig-Holstein to Danish control. In exchange, Russia gained control over the County of Oldenburg and adjacent lands in the Holy Roman Empire. This agreement was formalized in the Treaty of Tsarskoye Selo in 1773, and the resulting alliance significantly influenced Denmark's foreign policy, aligning it more closely with Russian interests in the subsequent decades.
Internally, the absolutist rule initiated under Frederick III continued to evolve. The Danish diet (parliament) had been suspended, and power became increasingly centralized in Copenhagen. The monarchy reorganized itself in a more hierarchical structure, with the king as the focal point. Crown officials and a new class of bureaucrats dominated governance, further diminishing the influence of the traditional aristocracy. Over time, non-noble landlords became influential, using their power to enact laws that favored their interests.
Denmark's administration and legal system also underwent modernization. In 1683, the *Danske lov 1683* (Danish Code) was introduced, standardizing and consolidating provincial laws. This era also saw the standardization of weights and measures and an agricultural survey that enabled direct taxation of landowners, reducing the government's reliance on revenue from crown lands.
Throughout this period, Denmark's population steadily increased, growing from about 600,000 in 1660, shortly after the territorial losses to Sweden, to 700,000 by 1720. By 1807, the population had reached approximately 978,000, reflecting the relative stability and growth of the kingdom during this era.