During the Reformation endemic religious upheavals and wars occurred, and in 1525, the last Grand Master of the Teutonic Knights, Albert of Prussia, a member of a cadet branch of the house of Hohenzollern, resigned his position, became a Protestant and received the title "Duke of Prussia" from the Polish king Sigismundus I the Elder in th act called Prussian Tribut. In a deal partially brokered by Martin Luther (under imperial ban since 1521), Ducal Prussia became the first Protestant state, along the lines of the later religious Peace of Augsburg. When the duke Albert of Prussia died in 1569, his son Albert Frederick and then Joachim II Hector inherited Prussia. The duchy of Prussia thus came to the senior Hohenzollern branch, the ruling Margraves of Brandenburg.
The second Treaty of Thorn (1466) had left eastern Prussia as a fief of the Polish crown. In 1660, after the Second Northern War between Sweden, Poland and Brandenburg, the Treaty of Welawa (Wehlau) granted full sovereignty to Frederick William I, the "Great Elector", of the Brandenburg Hohenzollerns as "Duke of Prussia". Thus Ducal Prussia lost its status as a Polish fief and became a part of Brandenburg-Prussia.
The medieval treaty also prescribed that in case the Hohenzollern dukes of Prussia died out, the land would go to the kingdom of Poland. (Active Hohenzollern rule expired in 1919, when Wilhelm II of Germany abdicated as German Emperor and King of Prussia.) The kingdom of Poland was re-instated by Germany with the Treaty of Brest-Litowsk, but became defunct with the Treaty of Versailles. The Polish nation which existed in 1945 was a successor of the Polish Kingdom only in locale, and in any case such old treaties would never have applied to modern nations as Germany and Poland were in the twentieth century.
East Prussia was put under temporary Polish and Soviet Administration with the communist military take-over in 1945, and was afterwards split in a Polish and Russiann part, its German population murdered or removed to Germany or the gulags.