Treaty of Tsarskoye Selo

[2] By the mid-17th century the so-called "Gottorp Question" of Holstein's relationship with the crown threatened the stability of the Danish kingdom, as the dukes of Holstein-Gottorp allied themselves with Sweden and other foreign powers against Denmark–Norway.

[3] Duke Charles Frederick sought support for the recovery of Schleswig in Russia, and in 1725 he married Russian Princess Anna Petrovna, the daughter of Emperor Peter the Great and sister of the future Empress Elizabeth.

[4] With the resources of Russia now backing his claims, Peter dispatched his minister Caspar von Saldern to the Danish court to demand the recovery of his former ducal territory in Schleswig, as well as the concession of the royal portion of Holstein, under threat of war.

The agreement was accepted by Catherine in 1767; after he came of age, Grand Duke Paul ratified the treaty on 1 June 1773 at the Russian imperial family's residence in Tsarskoye Selo, south of Saint Petersburg,[4] together with Danish King Christian VII.

[7] This territorial exchange placed the duchies of Schleswig and Holstein under a single sovereign, the Danish King, and ended the political and dynastic conflicts that had divided the region since its partition two centuries earlier.

[7] On the Russian side, the exchange allowed Catherine to turn Denmark–Norway from an enemy into an ally, furthering Nikita Ivanovich Panin's policy of building a Northern Accord to balance the power of Bourbon France;[4] a stronger Denmark would also help to contain Sweden (Russia's chief rival in the Baltic Sea region).

In 1774, Grand Duke Paul (at the urging of his mother) transferred the German lands obtained from the exchange to his great-uncle, Frederick August, and in 1777 they were united within a newly declared Duchy of Oldenburg.

Territorial borders in Schleswig-Holstein c. 1650 (with royal holdings in orange and ducal holdings in yellow), showing the region's extreme fragmentation
Danish Unification process of Holstein
The duchies of Schleswig, Holstein and Oldenburg c. 1789, showing the outcome of the treaty