East Prussia enclosed the bulk of the ancestral lands of the Baltic Old Prussians. During the 13th century, the native Prussians were conquered by the crusading Teutonic Knights. After the conquest the indigenous Balts were gradually converted to Christianity. Because of Germanization and colonisation over the following centuries, Germans became the dominant ethnic group, while Poles and Lithuanians formed minorities. From the 13th century, East Prussia was part of the monastic state of the Teutonic Knights. After the Second Peace of Thorn in 1466 it became a fief of the Kingdom of Poland. In 1525, with the Prussian Homage, the province became the Duchy of Prussia. The Old Prussian language had become extinct by the 17th or early 18th century.
Because the duchy was outside of the core Holy Roman Empire, the prince-electors of Brandenburg were able to proclaim themselves King beginning in 1701. After the annexation of most of western Royal Prussia in the First Partition of the Polish-Lithuanian Commonwealth in 1772, eastern (ducal) Prussia was connected by land with the rest of the Prussian state and was reorganized as a province the following year (1773). Between 1829 and 1878, the Province of East Prussia was joined with West Prussia to form the Province of Prussia.
The Kingdom of Prussia became the leading state of the German Empire after its creation in 1871. However, the Treaty of Versailles following World War I granted West Prussia to Poland and made East Prussia an exclave of Weimar Germany (the new Polish Corridor separating East Prussia from the rest of Germany), while the Memel Territory was detached and was annexed by Lithuania in 1923. Following Nazi Germany's defeat in World War II in 1945, war-torn East Prussia was divided at Joseph Stalin's insistence between the Soviet Union (the Kaliningrad Oblast in the Russian SFSR and the constituent counties of the Klaipėda Region in the Lithuanian SSR) and the People's Republic of Poland (the Warmian-Masurian Voivodeship). The capital city Königsberg was renamed Kaliningrad in 1946. The German population of the province was largely evacuated during the war or expelled shortly thereafter in the expulsion of Germans after World War II. An estimated 300,000 (around one fifth of the population) died either in war time bombings raids or in the battles to defend the province.
Upon the invitation of Duke Konrad I of Masovia, the Teutonic Knights took possession of Prussia in the 13th century and created a monastic state to administer the conquered Old Prussians. Local Old-Prussian (north) and Polish (south) toponyms were gradually Germanised. The Knights' expansionist policies, including occupation of Polish Pomerania with Gdańsk/Danzig and western Lithuania, brought them into conflict with the Kingdom of Poland and embroiled them in several wars, culminating in the Polish-Lithuanian-Teutonic War, whereby the united armies of Poland and Lithuania, defeated the Teutonic Order at the Battle of Grunwald (Tannenberg) in 1410. Its defeat was formalised in the Second Treaty of Thorn in 1466 ending the Thirteen Years' War, and leaving the former Polish region Pomerania/Pomerelia under Polish control. Together with Warmia it formed the province of Royal Prussia. Eastern Prussia remained under the Knights, but as a fief of Poland. 1466 and 1525 arrangements by kings of Poland were not verified by the Holy Roman Empire as well as the previous gains of the Teutonic Knights were not verified.
The Teutonic Order lost eastern Prussia when Grand Master Albert of Brandenburg-Ansbach converted to Lutheranism and secularized the Prussian branch of the Teutonic Order in 1525. Albert established himself as the first duke of the Duchy of Prussia and a vassal of the Polish crown by the Prussian Homage. Walter von Cronberg, the next Grand Master, was enfeoffed with the title to Prussia after the Diet of Augsburg in 1530, but the Order never regained possession of the territory. In 1569 the Hohenzollern prince-electors of the Margraviate of Brandenburg became co-regents with Albert's son, the feeble-minded Albert Frederick.