In 1523, George of Schellenberg had to sell Krnov to the Hohenzollern margrave George of Brandenburg-Ansbach, who could rely on the Hungarian inheritance of his consort Beatrice de Frangepan, widow of Matthias Corvinus. From 1532 the margrave ruled over all Upper Silesia, when he also inherited the Duchy of Opole and Racibórz from the Piast duke Jan II the Good. He had Krnov Castle rebuilt and introduced the Protestant Reformation in Silesia, having the local Teutonic Knights, Franciscans and Minorites expelled. The increasing power of the Protestant House of Hohenzollern in the Silesian crown lands was suspiciously eyed by Ferdinand I of Habsburg, Bohemian king since 1526. Nevertheless, George as well as his son Margrave George Frederick, who ruled from 1543, were able to keep the duchy. The conflict aggravated when George Frederick died childless in 1603 and bequested Krnov to his cousin Elector Joachim III Frederick of Brandenburg, who gave it to his son Johann Georg in 1607. The Habsburg rulers regarded the duchy a reverted fief and after the Bohemian Revolt and the 1620 Battle of White Mountain Emperor Ferdinand II confiscated the Hohenzollern possessions in his Bohemian lands. Ferdinand's loyal supporter Prince Karl I of Liechtenstein, Duke of Opava since 1613, received Krnov. Both duchies were merged in 1623 and subjected to Counter-Reformation.