Founded by Tsar Peter the Great on 27 May 1703, Saint Petersburg was built by Swedish prisoners from the Great Northern War (1700-1721). It became capital of the Russian Empire for more than two hundred years (1712–1728, 1732–1918). St. Petersburg ceased being the capital in 1918 after the Russian Revolution of 1917.