Originally inhabited mainly by the pagan Old Prussians, the regions were conquered and incorporated into the state of the Teutonic Knights in the 13th and 14th centuries. Under the Teutonic Order, the region's towns were founded, woodlands were cleared and marshlands made arable to be settled by colonists, predominantly from German-speaking areas but also from neighboring Polish and Lithuanian lands. By the Second Peace of Thorn (1466), Warmia and the Malbork Land were became subject to the Polish Crown as a part of Royal Prussia, a region initially holding considerable autonomy and keeping the German language. Masuria stayed part of the rump Teutonic state which became a German fief of the Polish-Lithuanian Commonwealth, finally secularised in 1525 to become the Ducal Prussia. The latter later emancipated and merged with the Electorate of Brandenburg, shortly thereafter becoming an independent Kingdom, and subsequently took direct control of the remaining areas in the First Partition of Poland (1772), and in 1773 included the area in the newly formed province of East Prussia. As a result of the Treaty of Versailles, a minor part around Soldau was transferred to Poland, the Klaipėda Region formed a free city supervised by the League of Nations, annexed following the Klaipėda Revolt by Lithuania but reclaimed by Germany in 1938, while the bulk (including entire Warmia and Masuria) remained a part of Germany, following the East Prussian plebiscite.