town: Arensburg (Kuressaare). Conquering the Baltics Small numbers of Ethnic Germans began to settle in the area in the late 12th century when traders and Christian missionaries began to visit the coastal lands inhabited by tribes who spoke Finnic and Baltic languages. Systematic conquest and settlement of these lands was completed during the Northern Crusades of the 12th and 13th centuries which resulted in creation of the Terra Mariana confederation, under the protection of Roman Popes and Holy Roman Empire. After the heavy defeat in the 1236 Battle of Saule the Livonian Brothers of the Sword became a part of the Teutonic Order. During the next three centuries German-speaking soldiers, clergymen, merchants and craftsmen constituted the majority of the quickly growing urban population, as the native inhabitants usually were prohibited from settling there. Membership in the Hanseatic League and active trade links with Russia and Europe increased wealth of Baltic German traders. Polish-Lithuanian and Swedish rule As the military power of the Teutonic Knights weakened during the 15th century wars with the Kingdom of Poland, Grand Duchy of Lithuania and Grand Duchy of Moscow, the Livonian branch in the north began to pursue its own policies. When the Prussian branch of the Order secularized in 1525 and became a Polish vassal state as the Duchy of Prussia, the Livonian branch remained independent while searching for a similar way to secularize. Livonia became mostly Protestant during the Reformation. In 1558, the Tsardom of Russia began the Livonian War against Terra Mariana which soon involved the Kingdoms of Poland, Sweden, and Denmark and lasted for 20 years. In 1561, Terra Mariana ceased to exist and was divided among Denmark (which took the island of Ösel), Sweden (which took northern Estonia) and Poland, which annexed the newly created Duchy of Livonia, and granted the Duchy of Courland and Semigallia, a vassal state of Poland-Lithuania, to the last Master of the Livonian Order Gotthard Kettler. The secularized land was divided among the remaining knights who formed the basis of Baltic nobility. The Duchy of Courland and Semigallia existed as a German-speaking country until 1795, while the northern part of Duchy of Livonia was conquered by Sweden which controlled parts of Estonia between 1561 and 1710 and Swedish Livonia between 1621 and 1710, having signed an agreement with the local Baltic German nobles not to undermine their political rights and autonomy. The Academia Gustaviana (now