The last "Hochmeister" Albert of Brandenburg-Ansbach converted to Lutheranism and, with the consent of his overlord and uncle, King Sigismund I of Poland, turned the State of the Teutonic Order into the secular Duchy of Prussia per the Treaty of Kraków, which was sealed by the Prussian Homage in Kraków in 1525. The commandries in the autonomous Livonian Terra Mariana likewise were lost by 1561. The Teutonic Order retained its bailiwicks in the Holy Roman Empire (Germany and Italy), however, which were administrated by the "Deutschmeister" since 1219,