Russia and the United Kingdom sign the Treaty of Gandamak establishing an Afghan state.

The Treaty of Gandamak (Dari: , Pashto: ) officially ended the first phase of the Second Anglo-Afghan War. Mohammad Yaqub Khan ceded various frontier areas to Britain while retaining full sovereignty over Afghanistan.

It was signed on 26 May 1879 by King Mohammad Yaqub Khan of Afghanistan and Sir Louis Cavagnari of British's Government of India at a British army camp near the village of Gandamak, about 70 miles (110 km) east of Kabul. The treaty was ratified by Lord Edward Robert Bulwer Lytton, Viceroy of India, on 30 May 1879.

Most historical writings consider the Treaty of Gandamak as the prelude to the second phase of the Second Anglo-Afghan War, 18791880. As result of the British victory at the Battle of Kandahar in 1880 the treaty was reaffirmed and the British appointed Abdur Rahman as Emir.

The Russian Empire (or Imperial Russia) was an empire that extended across Eurasia from 1721, succeeding the Tsardom of Russia following the Treaty of Nystad that ended the Great Northern War. The rise of the Russian Empire coincided with the decline of neighboring rival powers: the Swedish Empire, Poland–Lithuania, Persia, the Ottoman Empire, and Qing China. The Empire lasted 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 one point stretching over three continents—Europe, Asia, and North America—the Russian Empire was surpassed in size only by the British and Mongol empires. With 125.6 million subjects, according to 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 economic, ethnic, linguistic, and religious diversity.

From the 10th through the 17th centuries, the land was ruled by a noble class, the boyars, above whom was a tsar, who later became 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. The House of Romanov ruled the Russian Empire from its beginning in 1721 until 1762. Its matrilineal branch of patrilineal German descent, the House of Holstein-Gottorp-Romanov, ruled from 1762 until the end of the empire. At the beginning of the 19th century, the 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 North America, on the east. By the end of the 19th century, it would acquire Central Asia and parts of Northeast Asia.

Emperor Peter I (1682–1725) fought numerous wars and expanded an already vast empire into a major European power. He moved the capital from Moscow to the new model city of Saint Petersburg, which was largely built according to Western design. He led a cultural revolution that replaced some of the traditionalist and medieval social and political mores with a modern, scientific, Western-oriented, and rationalist system. Empress Catherine the Great (1762–1796) presided over a golden age; she expanded the state by conquest, colonization, and diplomacy, while continuing Peter I's policy of modernization along Western European lines. Emperor Alexander I (1801-1825) played a major role in defeating Napoleon's ambitions to control Europe, as well as constituting the Holy Alliance of conservative monarchies. Russia further expanded to the west, south, and east, becoming one of the most powerful European empires of the time. Its victories in the Russo-Turkish Wars were checked by defeat in the Crimean War (1853–1856), which led to a period of reform and intensified expansion in Central Asia. Emperor Alexander II (1855–1881) initiated numerous reforms, most dramatically the emancipation of all 23 million serfs in 1861. His policy in Eastern Europe officially involved the protection of Eastern Orthodox Christians within the Ottoman Empire. This was one factor leading to Russia's entry into World War I in 1914, on the side of the Allied powers against the Central Powers.

The Russian Empire functioned as an absolute monarchy on the ideological doctrine of Orthodoxy, Autocracy, and Nationality until the Revolution of 1905, when a nominal semi-constitutional monarchy was established. It functioned poorly during World War I, leading to the February Revolution and the abdication of Emperor Nicholas II, after which the monarchy was abolished. In the October Revolution, the Bolsheviks seized power, leading to the Russian Civil War. The Bolsheviks executed the imperial family in 1918 and established the Soviet Union in 1922 after emerging victorious from the civil war.