Allenstein was visited by Napoleon Bonaparte. Napoleon gathered enormous forces in the city and planned to engage the Russians and Prussians in a decisive battle. The Russian army was stationed in Jonkowo, but retreated after the French attack. Thanks to the victory at Allenstein, Napoleon's army was able to move north and a few days later the general Battle of Eylau took place. The growth of the city started again after it became a district seat in 1818, a significant influx of German settlers began and by 1825, the town was inhabited by 1,341 Germans and 1,266 Poles. In the early 1830s the city suffered from a cholera epidemic and a hunger crisis, however afterwards it flourished again, when despite Germanisation policies it was administered by Polish mayor Jakub Rarkowski from 1836 to 1865. Under Rarkowski the city was expanded and modernized, and the mayor also hid Polish insurgents in the city during the January Uprising. The first German-language newspaper, the Allensteiner Zeitung, began publishing in 1841. Polish historian Wojciech Kętrzyński was arrested in Jomendorf (the present-day district of Jaroty), and imprisoned in the city's High Gate in 1863 for smuggling weapons for the Polish January Uprising in the Russian Partition of Poland. The town hospital was founded in 1867. In 1871, with the unification of Germany, Allenstein became part of the German Empire. Two years later, the city was connected by railway to Thorn (Toruń). Despite Germanisation attempts the city remained an important Polish centre. Its first Polish language newspaper, the Gazeta Olsztyńska, was founded in 1886. Allenstein's infrastructure developed rapidly: gas was installed in 1890, telephones in 1892, public water supply in 1898, and electricity in 1907. The Provincial Mental Sanatorium Kortau was established in 1886 just south of Allenstein (today part of Olsztyn-Kortowo). In 1905, the city became the capital of Regierungsbezirk Allenstein, a government administrative region in East Prussia. From 1818 to 1910, the city was administered within the East Prussian Allenstein District, after which it became an independent city. World War I, interbellum and World War II Shortly after the outbreak of World War I in 1914, Russian troops captured Allenstein, but it was recovered by the Imperial German Army in the Battle of Tannenberg. After the defeat of Germany in World War I, the East Prussian plebiscite was held in 1920 to determine whether the populace of the region, including Allenstein, wished to remain