Marienburg (1410), during which the city outside was razed. In 1456, during the Thirteen Years' War, the Order – facing opposition from its cities for raising taxes to pay ransoms for expenses associated with its wars against Kingdom of Poland – could no longer manage financially. Meanwhile, Polish General Stibor de Poniec of Ostoja raised funds from Danzig for a new campaign against them. Learning that the Order's Bohemian mercenaries had not been paid, Stibor convinced them to leave. He reimbursed them with money raised in Danzig. Following the departure of the mercenaries, King Casimir IV Jagiellon entered the castle in triumph in 1457, and in May, granted Danzig several privileges in gratitude for the town's assistance and involvement in the Thirteen Years' War (1454–66) as well as for the funds collected for the mercenaries that left. The mayor of the town around the castle, Bartholomäus Blume, resisted the Polish forces for three more years, but the Poles captured and sentenced him to death in 1460. A monument to Blume was erected in 1864. Residence of the Polish kings In 1466 both castle and town became part of the Polish Malbork Voivodeship in the province of Royal Prussia. Since 1457 it served as one of the several Polish royal residences, fulfilling this function for over 300 years (over twice as long as it was headquarters of the Teutonic Order) until the Partitions of Poland in 1772. During this period the Tall Castle served as the castle's supply storehouse, while the Great Refectory was a place for balls, feasts, and other royal events. Polish Kings often stayed in the castle, especially when travelling to the nearby city of Gdańsk/Danzig. Local Polish officials resided in the castle. From 1568 the castle housed the Polish Admiralty (Komisja Morska) and in 1584 one of the Polish Royal Mints was established here. Also, the largest arsenal of the Polish–Lithuanian Commonwealth was located in the castle. By the decision of King John II Casimir Vasa of 1652, Jesuits took care of the castle chapels of Mary and St. Anne. During the Thirty Years' War, in 1626 and 1629 Swedish forces occupied the castle. They invaded and occupied it again from 1656 to 1660 during the Deluge. Then the castle was visited by Swedish kings Gustav Adolf (in 1626) and Charles X Gustav (in 1656). After the Partitions of Poland After Prussia and the Russian Empire made