The original inhabitants of the region were the Balt tribe of the Aesti, mentioned by Tacitus in his Germania. The town, known in German as Rastenburg and in Polish as Rastembork, was established in 1329 in the State of the Teutonic Knights and was granted town rights in 1357 by Henning Schindekop. In 1440, the town joined the anti-Teutonic Prussian Confederation. In 1454, the town recognized Polish KingCasimir IV Jagiellon as rightful ruler and the townspeople sent their representative to Königsberg to pay homage to the King. After the Thirteen Years’ War the town remained part of the Teutonic Order's state and, from 1525 to 1701, the Duchy of Prussia, a Polish fief until 1657. In the second half of the 17th century, Poles constituted around a half of the town's population, the other half being Germans. In 1667, a Polish church school was established. In 1701 the town became part of the Kingdom of Prussia and subsequently, in 1871, part of Germany. During the Seven Years' War, from 1758 to 1762, the town was occupied by the Russians, in June 1807, throughout the Napoleonic wars, the division of General Jan Henryk Dąbrowski was stationed in the town. In the years 1855-1859, Wojciech Kętrzyński, a historian, activist and Polish patriot, attended the local gymnasium. In the late 19th century a Polish Lutheran parish still existed in Rastenburg, despite the policy of Germanisation conducted by the Prussian authorities. In the second half of the 19th century, a sugar factory, brewery and mill were built.
20th century
Rastenburg and the surrounding district was the scene of the First World War's First Battle of the Masurian Lakes and Second Battle of the Masurian Lakes. During the Second World War Adolf Hitler's wartime military headquarters, the Wolfsschanze, was in the forest east of Rastenburg. The bunker was the setting for the failed assassination attempt of the 20 July plot against Hitler. In 1945, the area suffered devastation from both the retreating Germans and advancing Soviets during the Vistula-Oder campaign. Some ruins of the Wolfsschanze remain. The town was a Wehrmachtgarrison town until it was occupied by the Red Army on January 27, 1945. The largely abandoned town was heavily destroyed by the Soviets. After the war, the town was transferred to Poland under border changes promulgated at the Potsdam Conference. Its surviving German residents who had not evacuated were subsequently expelled westward and replaced with Poles, most of whom were themselves expelled from the pre-war Polish Vilnius Region that was annexed by the Soviet Union and given to the Lithuanian Soviet Socialist Republic. The town was given the historic Polish name Rastembork in 1945, and in 1946 it was renamed to Kętrzyn after the Polish historian Wojciech Kętrzyński. After the war, the town's life was being rebuilt. In 1945, the Municipal Theater was established. Thanks to voluntary contributions, books were purchased for newly organized public libraries. A museum was created in the renovated castle.
Climate
Although it officially qualifies as an oceanic, defined as Cfb for Köppen classification, its averages are much closer to a warm-summer humid continental climate, denoted as Dfb, being better defined like that. The climate of the city has a considerable thermal amplitude, but still with some not so pronounced influence of the sea.