In 1807, the castle was the headquarters of the French command during the Eylau campaign. Napoleon Bonaparte visited the Castle on February 3, 1807, before the battle of Allenstein. In 1845, the bridge connecting the castle to the town was replaced with a levee, the ditch was removed. Between 1901 and 1911, the castle underwent various renovations; this included the change in floor levels, and arched windows in the cloister. The castle became the Museum of the Warmian-Masurian Voivodeship in 1946; apart from various exhibitions the museum also hosts the Olsztyn Artistic Summer ("Olsztyńskie Lato Artystyczne").