The Great Northern War (1700–1721) was devastating, as Sweden and Russia fought for control of the Baltic. Harsh conditions—worsening poverty and repeated crop failures—among peasants undermined support for the war, leading to Sweden's defeat. Finland was a battleground as both armies ravaged the countryside, leading to famine, epidemics, social disruption and the loss of nearly half the population. By 1721 only 250,000 remained. Landowners had to pay higher wages to keep their peasants. Russia was the winner, annexing the south-eastern part, including the town of Viborg, after the Treaty of Nystad. The border with Russia came to lie roughly where it returned to after World War II. Sweden's status as a European great power was forfeited, and Russia was now the leading power in the North. The absolute monarchy ended in Sweden. During this Age of Liberty, the Parliament ruled the country, and the two parties of the Hats and Caps struggled for control leaving the lesser Court party, i.e. parliamentarians with close connections to the royal court, with little to no influence. The Caps wanted to have a peaceful relationship with Russia and were supported by many Finns, while other Finns longed for revenge and supported the Hats.