The Polish city was first mentioned in 1334, when Henryk von Luter erected a watchtower in the bend of the River Łyna. He gave it the name Allenstein (Gród nad Łyną) after the largest river flowing through Olsztyn. Allenstein (for the Poles Holstin and later Olstyn) received city rights in 1353. The principal and first mayor of Olsztyn was Johannes von Leysen.
Numerous wars between the Teutonic Order and Poland in the 15th century repeatedly destroyed the young city. In 1414, Olsztyn suffered from the army of King Władysław Jagiełło. In 1454 the local people took part in the uprising against the Order and occupied the castle, acknowledging the supremacy of the Polish king, but a year later the town returned to the control of the Knights again. It was only thanks to the Second Peace of Toruń (1466) that Olsztyn, along with Warmia, found itself within the borders of Poland. The next war with the Order in the years 1519-1521 ravaged Warmia. The contemporary administrator of the property of the Warmia chapter was the Frombork canon - Nicolaus Copernicus. In 1521, he successfully prepared the Olsztyn castle to defend against the expected attack of the Teutonic Knights.
The next century was a time of prosperity for the city, conveniently located on the busy route Królewiec-Warsaw. Development however was slowed down by war that raged in the 17th and 18th centuries, and the great plague of 1709-1712 that decimated the population of the city. As a result of the First Partition of Poland (1772), Warmia and Olsztyn were incorporated into Prussia.
During the Napoleonic wars, the city was once again destroyed. After 1818, the city buildings went beyond the walls of the Old Town. The second half of the nineteenth century was a time of dynamic development. In 1867, a modern hospital was built, in 1872, Olsztyn was the first railway stop to be included in the route connecting Toruń and Insterburg. In 1890, the first gas streetlamps were lit up. Two years layer the first telephone rang, six years later a modern sewage system was built, and in 1907 Olsztyn was electrified. Trams appeared on the streets of the city. In 1910, the first plane landed in Dajtki.
After the First World War - in 1920 - the Plebiscite decided on the future of the southern part of East Prussia. Olsztyn and Warmia remained in Germany. On January 22, 1945, Olsztyn was occupied by the Red Army. After a few days of stationing, the Red Army set fire to the city and almost half of the buildings, including the Old Town, were destroyed.
After 1945, Olsztyn became the capital of the province. Today, Olsztyn is also an important tourist centre, mainly thanks to its location among lakes and forests, but also thanks to numerous monuments and other tourist attractions. Olsztyn's monuments are located on the European Brick Gothic Route, the Gothic Castles' Route, the Copernicus Trail, the Św. Jacob Trail.