St. Petersburg was the capital of Russia for over two centuries, from 1712 to 1918. However, after the Russian Revolution, Moscow became the capital and has remained so to this day. This shift in political power has led to a decline in St. Petersburg's population and economy, while Moscow has continued to grow and prosper.