In 1466 both castle and town became part of Royal Prussia, a province of Poland. It served as one of the several Polish royal residences, fulfilling this function 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.