Human habitation in Afghanistan dates back to the Middle Paleolithic Era, and the country's strategic location along the Silk Road connected it to the cultures of the Middle East and other parts of Asia. The land has historically been home to various peoples and has witnessed numerous military campaigns, including those by Alexander the Great, Mauryas, Muslim Arabs, Mongols, British, Soviets, and since 2001 by the United States with NATO-allied countries. It has been called "unconquerable" and nicknamed the "graveyard of empires," though it has been occupied during several different periods of its history. The land also served as the source from which the Kushans, Hephthalites, Samanids, Saffarids, Ghaznavids, Ghorids, Khaljis, Mughals, Hotaks, Durranis, and others have risen to form major empires.
The political history of the modern state of Afghanistan began with the Hotak and Durrani dynasties in the 18th century. In the late 19th century, Afghanistan became a buffer state in the "Great Game" between British India and the Russian Empire. Its border with British India, the Durand Line, was formed in 1893 but it is not recognized by the Afghan government and it has led to strained relations with Pakistan since the latter's independence in 1947. Following the Third Anglo-Afghan War in 1919 the country was free of foreign influence, eventually becoming a monarchy under King Amanullah, until almost 50 years later when Zahir Shah was overthrown and a republic was established. In 1978, after a second coup Afghanistan first became a socialist state and then a Soviet Union protectorate. This evoked the Soviet–Afghan War in the 1980s against mujahideen rebels. By 1996 most of Afghanistan was captured by the Islamic fundamentalist group the Taliban, who ruled most of the country as a totalitarian regime for over five years. The Taliban were forcibly removed by the NATO-led coalition, and a new democratically-elected government political structure was formed, but they still control a significant portion of the country.