Riga
The quarrel with the archbishop faded once Riga accepted the Reformation in 1522, and from then on the burghers' aim was to keep their council, their privileges and their Lutheran churches under whichever power ruled the eastern Baltic. When the Livonian Order collapsed in the Livonian War, Riga held out for twenty years as a free imperial city before swearing homage in 1581 to Stephen Báthory, King of Poland. He confirmed its liberties but handed two of its main churches back to the Catholics, and when the Gregorian calendar was imposed, the townsmen rose in the Calendar Riots, seized the churches again and drove out the Jesuits. Gustavus Adolphus took the city for Sweden in 1621; as the second city of the Swedish kingdom it was heavily fortified, and it beat off a Russian siege in 1656. Peter the Great finally captured it in 1710, after a long siege during which plague swept the town, and he too left its privileges largely in place.