In the 1830s, England and North Germany planned to construct a railway line between the cities of Hamburg and Lübeck to ease transport between the North Sea and the Baltic Sea. The Copenhagen government frowned on this, as they wanted to retain waterway traffic through Øresund, but to preempt these efforts, the Danish government set up the first Danish railway commission in 1835 to establish the layout of a railway line through the Duchy of Holstein. Consequently, the railway between Altona and Kiel was opened by King Christian VIII on 18 September 1844. However, the Duchy of Holstein was only in personal union with Denmark, with the King of Denmark being Duke of Holstein, and as a result of the Second War of Schleswig, Holstein was ceded to the German Confederation in 1864. The railway line was not the first in what constituted Denmark at the time (as Holstein was part of the German Confederation), but it was nonetheless the first to be built under the Danish monarchy.