After the Finnish War, which ended when Sweden ceded Finland to Imperial Russia at the Treaty of Fredrikshamn in 1809, Turku became briefly the official capital, but soon lost the status to Helsinki, as Emperor Alexander I felt that Turku was too far from Russia and too aligned with Sweden to serve as the capital of the Grand Duchy of Finland.