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, activist and patriot Wojciech Kętrzyński, who attended the local gymnasium in the years 1855-1859.