life in Sigtuna continued until town started to slowly lose its importance during 13th century due to navigability problems caused by post-glacial rebound. In 1227, Saaremaa was conquered by the Livonian Brothers of the Sword during the Livonian Crusade but the resistance of the local inhabitants remained strong. The crusaders founded the Bishopric of Ösel–Wiek there. When the Order was defeated by the Lithuanian army in the Battle of Saule in 1236, the Saaremaa islanders rebelled. The conflict was ended by a treaty that was signed by the Osilians and the Master of the Order. In the following year, the Sword-Brothers were absorbed into the Teutonic Order. As the crusaders' hold on Saaremaa got stronger, Christianity also became more established on the island, and to this day Saaremaa has a unique set of medieval churches in Kaarma, Karja, Kihelkonna, Muhu, Pöide, Püha and Valjala churches. The crusader's fortress Kuressaare Castle, known in German as Schloss Arensburg, was built by the Teutonic Order for the bishops of Ösel–Wiek (Estonian: Saare-Lääne). Construction began in 1380 and it is one of the most well-preserved medieval castles in Estonia and bears testimony to the late Medieval Age. During the 14th–16th centuries, and possibly earlier, local inhabitants started to expand across the Baltic Sea into surrounding areas thus establishing villages on the Livonian coast. Most of Saaremaa was ruled directly by the Bishopric of Ösel–Wiek, while some parts were enfeoffed to the Livonian Order. In 1559, the bishopric and Saaremaa were sold to Denmark, becoming part of Danish Estonia. From 1570 until 1645 the entire island was under Danish possession. In 1645, Saaremaa was ceded from Denmark to Sweden by the Treaty of Brömsebro. In 1721, along with the rest of Livonia, Saaremaa (then known by its Swedish name of Ösel) was ceded to the Russian Empire by the Treaty of Nystad, becoming a part of the Governorate of Livonia. In 1840 the first spa opened in Kuressaare (then known as Arensburg), and the town experienced renaissance and became a resort for Russians and Baltic Germans. In World War I, the Estonian islands were conquered by Imperial German Army in October 1917 (Operation Albion) and remained occupied by Germans until the end of hostilities in November 1918. Thereafter Saaremaa became part of the newly independent Republic of Estonia. Most of the local Baltic German population of the island was resettled to Germany following the August