In 1600, the Polish–Swedish War broke out, causing further devastation. The protracted war ended in 1629 with Sweden gaining Livonia, including the regions of Southern Estonia and Northern Latvia. Danish Saaremaa was transferred to Sweden in 1645. The wars had halved the Estonian population from about 250–270,000 people in the mid 16th century to 115–120,000 in the 1630s.