Russia signs the Treaty of Brest-Litovsk, agreeing to withdraw from World War I, and conceding German control of the Baltic States, Belarus and Ukraine. It also conceded Turkish control of Ardahan, Kars and Batumi.

World War I or the First World War, often abbreviated as WWI or WW1, began on 28 July 1914 and ended on 11 November 1918. Referred to by contemporaries as the "Great War", its belligerents included much of Europe, the Russian Empire, the United States, and the Ottoman Empire, with fighting also expanding into the Middle East, Africa, and parts of Asia. One of the deadliest conflicts in history, an estimated 9 million people were killed in combat, while over 5 million civilians died from military occupation, bombardment, hunger, and disease. Millions of additional deaths resulted from genocides within the Ottoman Empire and the 1918 influenza pandemic, which was exacerbated by the movement of combatants during the war.By 1914, the European great powers were divided into the Triple Entente of France, Russia, and Britain; and the Triple Alliance of Germany, Austria-Hungary, and Italy. Tensions in the Balkans came to a head on 28 June 1914 following the assassination of Archduke Franz Ferdinand, the Austro-Hungarian heir, by Gavrilo Princip, a Bosnian Serb. Austria-Hungary blamed Serbia, which led to the July Crisis, an unsuccessful attempt to avoid conflict through diplomacy. Russia came to Serbia's defense following Austria-Hungary's declaration of war on the latter on 28 July, and by 4 August, the system of alliances drew in Germany, France, and Britain, along with their respective colonies. In November, the Ottoman Empire, Germany, and Austria-Hungary formed the Central Powers, while in April 1915, Italy switched sides to join Britain, France, Russia, and Serbia in forming the Allies of World War I.

Facing a war on two fronts, German strategy in 1914 was to first defeat France, then shift its forces to Eastern Europe and knock out Russia in what was known as the Schlieffen Plan. However, Germany's advance into France failed, and by the end of 1914, the two sides faced each other along the Western Front, a continuous series of trench lines stretching from the English Channel to Switzerland that changed little until 1917. By contrast, the Eastern Front was far more fluid, with Austria-Hungary and Russia gaining and then losing large swathes of territory. Other significant theatres included the Middle Eastern Theatre, the Italian Front, and the Balkans Theatre, drawing Bulgaria, Romania, and Greece into the war.

By early 1915 Russia had been seeing defeat after defeat in the twin Battle of Tannenberg and the Battle of the Masurian Lakes. The Russians had suffered around 450,000 casualties in all of those battles, by then their armies were demoralized and the Germans had sent the bulk of their armies towards the Eastern Front. The siege of Przemyl had been a success for the Russians but by April the Germans had began drawing up plans to liberate Galicia. By May the Germans had launched the GorliceTarnw offensive, an offensive which eventually turned into a Russian retreat. By the 5th of August, Warsaw had been occupied by the Germans. The battle finally ended in September 1915 with the entirety of Poland and parts of Minsk being occupied.

Shortages caused by the Allied naval blockade led Germany to initiate unrestricted submarine warfare in early 1917, bringing the previously-neutral United States into the war on 6 April 1917. In Russia, the Bolsheviks seized power in the October Revolution of 1917, and made peace in the Treaty of Brest-Litovsk on 3 March 1918, freeing up a large number of German troops. By transferring these forces to the Western Front, the German General Staff hoped to win a decisive victory before American reinforcements could impact the war, and launched the German spring offensive in March 1918. Despite initial success, it was soon halted by heavy casualties and ferocious defence; in August, the Allies launched the Hundred Days Offensive and although the Imperial German Army continued to fight hard, it could no longer halt their advance.Towards the end of 1918, the Central Powers began to collapse; Bulgaria signed an armistice on 29 September, followed by the Ottomans on 31 October, then Austria-Hungary on 3 November. Isolated, facing the German Revolution at home and a military on the verge of mutiny, Kaiser Wilhelm abdicated on 9 November, and the new German government signed the Armistice of 11 November 1918, bringing the conflict to a close. The Paris Peace Conference of 19191920 imposed various settlements on the defeated powers, with the best-known of these being the Treaty of Versailles. The dissolution of the Russian, German, Ottoman, and Austro-Hungarian empires led to numerous uprisings and the creation of independent states, including Poland, Czechoslovakia, and Yugoslavia. For reasons that are still debated, failure to manage the instability that resulted from this upheaval during the interwar period ended with the outbreak of World War II in September 1939.

The Russian Soviet Federative Socialist Republic (Russian SFSR or RSFSR; Russian: Российская Советская Федеративная Социалистическая Республика, tr. Rossíyskaya Sovétskaya Federatívnaya Socialistíčeskaya Respúblika, IPA: [rɐˈsʲijskəjə sɐˈvʲetskəjə fʲɪdʲɪrɐˈtʲivnəjə sətsɨəlʲɪˈsʲtʲitɕɪskəjə rʲɪˈspublʲɪkə] (listen)), previously known as the Russian Soviet Republic and the Russian Socialist Federative Soviet Republic as well as being unofficially known as Soviet Russia, the Russian Federation or simply Russia, was an independent federal socialist state from 1917 to 1922, and afterwards the largest and most populous of the Soviet socialist republics of the Soviet Union (USSR) from 1922 to 1991, until becoming a sovereign part of the Soviet Union with priority of Russian laws over Union-level legislation in 1990 and 1991, the last two years of the existence of the USSR. The Russian Republic was composed of sixteen smaller constituent units of autonomous republics, five autonomous oblasts, ten autonomous okrugs, six krais and forty oblasts. Russians formed the largest ethnic group. The capital of the Russian SFSR was Moscow and the other major urban centers included Leningrad, Stalingrad, Novosibirsk, Sverdlovsk, Gorky and Kuybyshev.

The economy of Russia became heavily industrialized, accounting for about two-thirds of the electricity produced in the USSR. By 1961, it was the third largest producer of petroleum due to new discoveries in the Volga-Urals region and Siberia, trailing in production to only the United States and Saudi Arabia. In 1974, there were 475 institutes of higher education in the republic providing education in 47 languages to some 23,941,000 students. A network of territorially organized public-health services provided health care. After 1985, the "perestroika" restructuring policies of the Gorbachev administration relatively liberalised the economy, which had become stagnant since the late 1970s under General Secretary Leonid Brezhnev, with the introduction of non-state owned enterprises such as cooperatives.

On 7 November 1917, as a result of the October Revolution, the Russian Soviet Republic was proclaimed as a sovereign state and the world's first constitutionally socialist state guided by communist ideology. The first constitution was adopted in 1918. In 1922, the Russian SFSR signed a treaty officially creating the USSR. The Russian SFSR's 1978 constitution stated that "[a] Union Republic is a sovereign [...] state that has united [...] in the Union" and "each Union Republic shall retain the right freely to secede from the USSR". On 12 June 1990, the Congress of People's Deputies adopted the Declaration of State Sovereignty, established separation of powers (unlike in the Soviet form of government), established citizenship of Russia and stated that the RSFSR shall retain the right of free secession from the USSR. On 12 June 1991, Boris Yeltsin (1931–2007), supported by the Democratic Russia pro-reform movement, was elected the first and only president of the RSFSR, a post that would later become the presidency of the Russian Federation.

The August 1991 Soviet coup d'état attempt with the temporary brief internment of President Mikhail Gorbachev destabilised the Soviet Union. On 8 December 1991, the heads of Russia, Ukraine and Belarus signed the Belovezh Accords. The agreement declared dissolution of the USSR by its original founding states (i.e., renunciation of the 1922 Treaty on the Creation of the USSR) and established the Commonwealth of Independent States (CIS) as a loose confederation. On 12 December, the agreement was ratified by the Supreme Soviet (the parliament of Russian SFSR); therefore the Russian SFSR had renounced the Treaty on the Creation of the USSR and de facto declared Russia's independence from the USSR itself and the ties with the other Soviet Socialist Republics.

On 25 December 1991, following the resignation of Gorbachev as President of the Soviet Union (and former General Secretary of the Communist Party of the Soviet Union), the Russian SFSR was renamed the Russian Federation. The next day after the lowering of the Soviet red flag from the top of the Kremlin Senate building of the Moscow Kremlin in Moscow, the USSR was self-dissolved by the Soviet of the Republics on 26 December, which by that time was the only functioning parliamentary chamber of the All-Union Supreme Soviet (the other house, Soviet of the Union, had already lost the quorum after recall of its members by the several union republics). After the dissolution, Russia declared that it assumed the rights and obligations of the dissolved central Soviet government, including UN membership and permanent membership on the Security Council, but originally excluding foreign debt and foreign assets of the USSR (also parts of the former Soviet Army and nuclear weapons remained under overall CIS command as CIS United Armed Forces).

The 1978 constitution of the Russian SFSR was amended several times to reflect the transition to democracy, private property and market economy. The new Russian constitution, coming into effect on 25 December 1993 after a constitutional crisis, completely abolished the Soviet form of government and replaced it with a semi-presidential system.