Holstein once existed as the County of Holstein (German: Grafschaft Holstein), the later Duchy of Holstein (German: Herzogtum Holstein), and was the northernmost territory of the Holy Roman Empire. The history of Holstein is closely intertwined with the history of the Danish Duchy of Schleswig. The capital of Holstein is Kiel.
Holstein's name comes from the Holcetae, a Saxon tribe mentioned by Adam of Bremen as living on the north bank of the Elbe, to the west of Hamburg. The name means "dwellers in the wood".
In 1474, Holstein was raised to a duchy and became a state of the Holy Roman Empire (reichsunmittelbar), which it remained until the dissolution of the Empire in 1806.
In 1490, Holstein was divided into Holstein-Segeberg and Holstein-Gottorp. Holstein-Segeberg remained with the Danish king and was also known as Royal Holstein; later it came to be known as Holstein-Glückstadt. Holstein-Gottorp, also known as Ducal Holstein, was given to a cadet branch of the House of Oldenburg, to which the kings of Denmark belonged.
The Duke of Holstein-Gottorp became emperor of Russia in 1762 as Peter III and was planning an attack on Denmark to recover the lost Holstein-Gottorp lands in Schleswig. Although Peter was soon overthrown by his wife, Catherine the Great, the Danes determined to rid themselves of this problem. In 1773, they exchanged the County of Oldenburg for the Gottorp lands in Holstein, bringing all of Holstein under their control. Thus, Holstein was again united in one state.
Because of its personal union with Denmark, the Duchy of Holstein did not come under French control during the Napoleonic era. From 1815 to 1864 it was a member of the German Confederation, though still in personal union with Denmark (the King of Denmark being also Duke of Holstein). Following the death of King Frederick VII of Denmark in 1863, the inheritance of Schleswig and Holstein was disputed. The new king, Christian IX, made his claim to the Danish throne through a female line. The Duke of Augustenborg, a minor scion from another line of the family, claimed the Duchies, and soon the German Confederation, led by Prussia and Austria, went to war with Denmark, quickly defeating it in 1864 and forcing it to cede the duchies. However, the duchies were not given to the Duke of Augustenborg. In 1865 an arrangement was worked out between Prussia and Austria where the Austrians occupied and administered Holstein, while the Prussians did the same in Schleswig. This arrangement came to an end with the Austro-Prussian War of 1866, which resulted in Schleswig and Holstein both being incorporated into Prussia as the Province of Schleswig-Holstein.