During the Polish–Teutonic War (1326–1332), the city was captured and destroyed by the Teutonic Knights in 1330. Briefly regained by Poland, it was occupied by the Teutonic Knights from 1331 to 1337 and annexed into their monastic state as "Bromberg". In 1337 it was recaptured by Poland and was relinquished by the Knights in 1343 with their signing of the Treaty of Kalisz along with Dobrzyń and the remainder of Kuyavia. King Casimir III of Poland, granted Bydgoszcz city rights (charter) on 19 April 1346. The king granted a number of privileges, regarding river trade on the Brda and Vistula and the right to mint coins, and ordered the construction of the castle, which became the seat of the castellan. Bydgoszcz was an important royal city of Poland located in the Inowrocław Voivodeship.