Saaremaa's earliest coastal settlements (dating from the 4th millennium BC) now lie inland because the land has risen about 15m over the last 5000 years. In the 10th to 13th centuries Saaremaa and Muhu were the most densely populated parts of Estonia. Denmark tried to conquer Saaremaa in the early 13th century; however in 1227 the German Knights of the Sword subjugated it. The island was then carved up between the knights, who took Muhu and eastern and northwestern parts of Saaremaa, and the Haapsalu-based bishop of Ösel-Wiek, who made Kuressaare his stronghold.
Saaremaa rebelled against German rule numerous times between 1236 and 1343 (when the Knights' castle was destroyed and the Germans were expelled from the island), though their efforts were always short-lived (in 1345 the Germans reconquered the island).
In the 16th century Saaremaa became a Danish possession during the Livonian War, but by 1645 the Swedes had their turn compliments of the Treaty of Brömsebro. Russia took over in 1710 during the Great Northern War and Saaremaa became part of the Russian province of Livonia, governed from Rīga.