 Its defeat was formalised in the Second Treaty of Thorn in 1466 ending the Thirteen Years' War, and leaving the former Polish region Pomerania/Pomerelia under Polish control.Together with Warmia it formed the province of Royal Prussia.Eastern Prussia remained under the Knights but as a fief of Poland.