Under the young, weak Nicholas II, ignominious defeat in the war with Japan (1904-5) led to further unrest. The massacre of civilians on Bloody Sunday led to mass strikes and the murder of industrialists. Social Democrat activists formed workers' councils (soviets), and a general strike in October 1905 brought the country to its knees. The tsar finally buckled and permitted the formation of the country's first parliament (duma), only to disband it when he didn't like its leftist demands. Russia's disastrous performance in WWI fomented further unrest. Soldiers and police mutinied and a reconvened duma assumed government, manned by the commercial elite. Soviets of workers and soldiers were also formed, thus creating two alternative power bases. Both were unified in their demands for the abdication of the tsar, an action Nicholas was forced to undertake on 1 March 1917.
On 25 October a splinter group of Social Democrats (known as Bolsheviks and led by the exiled Lenin) seized control and empowered the soviets as the ruling councils. Headed by Lenin and supported by Trotsky and Stalin, the soviet government redistributed land to those who worked it, signed an armistice with Germany and created Trotsky's Red Army. In March 1918 the Bolshevik Party was renamed the Communist Party and the nation's capital was moved from Petrograd (St Petersburg's new, un-German-sounding name) to Moscow. Strongholds of those hostile to the communist regime had developed in the south and east of the country. Their collective name, the Whites, was their only source of cohesion. Three years of civil war resulted, with over a million citizens fleeing.
The economic consequences of the civil war were disastrous, culminating in the enormous famine of 1920-21. The Union of Soviet Socialist Republics (USSR) was established in 1922 and, following Lenin's death in January 1924, new lows in human brutality were reached by his successor, Josef Stalin, who introduced farm collectivisation, destroying the peasantry both as a class and as a way of life. Millions were executed or exiled to Siberian concentration camps.
Stalin was keen to avoid embroilment in WWII, which engulfed Europe in 1939, and the Ribbentrop-Molotov nonaggression pact was signed. The tables turned in 1941 when Hitler's invasion of Russia (Operation Barbarossa) issued in a bloody period of warfare that would eventually kill a sixth of the Soviet population. The battles for Leningrad (former Petrograd) and Stalingrad (today again known as Volgograd) were particularly protracted and obscene. One million Soviet troops died defending Stalingrad, the symbolically important namesake of their leader.
At the war's end, the Soviet's 'liberation' of Eastern Europe was soon recognised as a misnomer. Russia's extended control over much of Eastern Europe was the key to its emergence as one of the world's superpowers. Stalin re-established the old pattern of unpredictable purges and, as the Cold War developed, he established Western ideology as the country's new enemy. Following Stalin's death in 1953, Nikita Krushchev emerged as leader and cautiously attempted to de-Stalinise the Party with his secret speech in 1956, which lambasted the cult of personality and sent shock waves around the world. Krushchev, long held to be an embarrassment to the Soviet nation due to his brash peasant ways, was eventually toppled in a coup lead by his long-time protégé, Leonid Brezhnev.
Despite increased repression, dissident movements sprang up. But change was on the way and Soviet communism's poor image was soon thoroughly overhauled by iconoclast Mikhail Gorbachev.
Gorbachev introduced political and economic reforms (perestroika) and called for greater openness (glasnost). In 1988 he held elections to transfer power from the Party to a new parliament. Reduced repression led to the eventual independence of the 15 Soviet republics, with the Baltic republics leading the way. This reduced sphere of influence and severe economic crisis caused Gorbachev domestic strife. A reactionary coup in August 1991 opened the way for his even more radical successor, Boris Yeltsin.
Post-Soviet Russia was marked by the misdealings of corrupt officials, financiers and out-and-out gangsters, as well as soaring rates of corruption, racketeering and murder. Despite the unpopularity of change, Russians narrowly voted back the indecisive, incoherent president Yeltsin in mid-1996 elections. The Yeltsin era was marked by the globalisation - by hook and by crook - of the Russian economy. The new democracy veered between the rise of ultra-nationalism and communist nostalgia. By 1999 things were looking even shakier - Yeltsin sacked his governments regularly, but the economy was getting steadily gloomier. In August 1998 the ruble was floated and immediately went into freefall. In March 2000, Vladimir Putin became president of Russia, after six months in a caretaker position.