The Russian Empire was an empire that extended across Eurasia and North America from 1721, following the end of the Great Northern War, until the Republic was proclaimed by the Provisional Government that took power after the February Revolution of 1917. The third-largest empire in history, at its greatest extent stretching over three continents, Europe, Asia, and North America, the Russian Empire was surpassed in size only by the British and Mongol empires. The rise of the Russian Empire coincided with the decline of neighboring rival powers: the Swedish Empire, the Polish–Lithuanian Commonwealth, Persia and the Ottoman Empire. It played a major role in 1812–1814 in defeating Napoleon's ambitions to control Europe and expanded to the west and south. The House of Romanov ruled the Russian Empire from 1721 until 1762. Its matrilineal branch of patrilineal German descent, the House of Holstein-Gottorp-Romanov, ruled from 1762 to the end of the empire. At the beginning of the 19th century, the Russian Empire extended from the Arctic Ocean in the north to the Black Sea in the south, from the Baltic Sea on the west into Alaska and Northern California in America on the east. With 125.6 million subjects registered by the 1897 census, it had the third-largest population in the world at the time, after Qing China and India. Like all empires, it featured great diversity in terms of economies, ethnicities, languages, and religion. There were many dissident elements that launched numerous rebellions and assassinations over the centuries. In the 19th century, they were closely watched by the imperial secret police, and thousands were exiled to Siberia. Economically, the empire was predominantly agricultural, with low productivity on large estates worked by Russian peasants, known as serfs, who were tied to the land in a feudal arrangement. The serfs were freed in 1861, but the landowning aristocratic class kept control. The economy slowly industrialized with the help of foreign investments in railways and factories. From the 10th through the 17th centuries, the land was ruled by a noble class, the boyars, and subsequently by an emperor. Tsar Ivan III (1462–1505) laid the groundwork for the empire that later emerged. He tripled the territory of his state, ended the dominance of the Golden Horde, renovated the Moscow Kremlin, and laid the foundations of the Russian state. Emperor Peter the Great (1682–1725) fought numerous wars and expanded an already huge empire into a major European power. He moved the capital from Moscow to the new model city of St. Petersburg, which featured much European design. He led a cultural revolution that replaced some of the traditionalist and medieval social and political mores with a modern, scientific, Europe-oriented, and rationalist system. Empress Catherine the Great (reigned 1762–1796) presided over a golden age; she expanded the state by conquest, colonization and diplomacy, continuing Peter the Great's policy of modernization along Western European lines. Emperor Alexander II (1855–1881) promoted numerous reforms, most dramatically the emancipation of all 23 million serfs in 1861. His policy in Eastern Europe involved protecting the Orthodox Christians under the rule of the Ottoman Empire. That connection by 1914 led to Russia's entry into the First World War on the side of France, the United Kingdom, and Serbia, against the German, Austria-Hungary, and Ottoman empires. The Russian Empire functioned as an absolute monarchy on principles of Orthodoxy, Autocracy, and Nationality until the Revolution of 1905. A de jure constitutional monarchy was established. The empire collapsed during the February Revolution of 1917, largely as a result of massive failures resulting from its participation in the First World War. The royal family was executed in 1918 by the Bolsheviks, who imprisoned or executed many of the aristocratic class before seizing power.