The town was founded as a defensive stronghold on an Old Prussian site. In
1224 at Catania, Emperor Frederick II declared Prussia directly subordinate to
the church and Holy Roman Empire. Later in the same year the pope assigned
Bishop William of Modena as the papal legate to Prussia. With the imperial
Golden Bull of Rimini, the Teutonic Knights were granted control of the region,
which they subsequently conquered. According to local legend, the Old Prussian
inhabitants were baptised by Anselm of Meissen, a priest of the Teutonic
Knights and the first Bishop of the Bishopric of Warmia which was created in
1242 by