Mohrungen was again devastated during the Polish–Swedish War in 1626. From 1701 it was part of the Kingdom of Prussia under King Frederick I. It remained the seat of the local administration, since 1752 of "Landkreis Mohrungen" (Mohrungen district). Despite being outside of Polish suzerainty since 1657, in the 18th century Poles still inhabited the town and its surroundings, and the town owed its prosperity to trade routes connecting with Poland. The town was within short distances surrounded by Polish territory. During the Napoleonic War of the Fourth Coalition, in 1807, Marshal Jean-Baptiste Jules Bernadotte took his residence at Dohna Castle; his French forces were defeated in a skirmish with Russian troops on January 25, 1807. An earthquake struck the town in 1818.