 During the Napoleonic Wars in 1807 the Marshal of France Michel Ney stayed in Olsztynek.After the 1871 unification of Germany the town lay inside the German Empire.Although Olsztynek was outside the authority of Poland after 1657, in the late 19th century Poles still formed the majority of the local Lutheran parish (majority of the town's population was Lutheran), with 3,344 people in comparison to 1,966 Germans.