During the history of Afghanistan, several superpowers have attempted to invade Afghanistan without maintaining a stable, permanent rule. Modern examples included the British Empire during the first and Third Anglo-Afghan Wars (1839–1842, 1919), the Soviet Union in the Soviet–Afghan War (1979–1989) and the United States in the War in Afghanistan (2001–2021). Some had attributed ancient empires to the narrative, including the Persians, Greeks, Arabs, Turks and Mongols. The difficulty in invading Afghanistan was attributed to the prevalence of fortress-like qalats, the deserts, the mountainous terrain of Afghanistan, its severe winter and its "impregnable clan loyalties", and outside neighboring countries support such as Pakistan, where foreign invaders were unable or not permitted to cross into such nations to destroy their enemy sanctuaries.