Treaty of Nystad
The defeats suffered by Charles XII in the Great Northern War ended Sweden's position as a first-rank European power. Under Frederick, this had to be accepted. Sweden also had to cede Estonia, Ingria and Livonia to Russia in the Treaty of Nystad, in 1721.