The last war between Poland and the Order of Teutonic Knights was fought in 1519-1521. The war ended after HRE called Poland and the Order to cease hostilities in face of Ottoman invasion of Hungary. However, Poland was closer to victory, since Order's resources were exhausted. Moreover, Poland could have won already in 1519, but Polish/Masovian/Danzig forces were halted by pope's legates until Teutonic reinforcements from Germany arrived.
After the war king Sigismund I allowed Order's State to be transformed into secular, protestant duchy, vassal of Polish Crown, ruled by Albrecht Hohenzollern.
However, it didn't have to be so. WI pope's legates didn't manage to stop Poles and Poland won decisive victory already in 1519, and captured Koenigsberg in 1520? WI after the war victorious king Sigismund I decided to incorporate Prussia into Poland?
After the war king Sigismund I allowed Order's State to be transformed into secular, protestant duchy, vassal of Polish Crown, ruled by Albrecht Hohenzollern.
However, it didn't have to be so. WI pope's legates didn't manage to stop Poles and Poland won decisive victory already in 1519, and captured Koenigsberg in 1520? WI after the war victorious king Sigismund I decided to incorporate Prussia into Poland?