 On his release he renounced his royal title.Magnus spent the last six years of his life at the castle of Pilten in the Bishopric of Courland where he died (March 1583) as a pensioner of the Polish crown.The end of the Livonian War in August 1583 saw most of the territory of Old Livonia (Duchy of Courland and Semigallia and Duchy of Livonia) under the control of the Polish–Lithuanian Commonwealth, with Swedish control established in the Duchy of Estonia.