The states of the Livonian Confederation ceased to exist during the Livonian War of 1558–1582. In 1559 the Bishop of Ösel-Wiek and Courland Johannes V von Münchhausen (1542–1560) sold his lands to King Frederick II of Denmark for 30,000 thalers. The Danish king gave the territory to his younger brother Duke Magnus of Holstein who in 1560 landed with an army on Ösel.