Several external empires have successfully conquered and held the territory that would become Afghanistan. Pre-historic archaeological evidence shows that the Indus Valley Civilization had outposts as far northwest as modern Afghanistan, and the ancient nomadic Indo-Europeans conquered the region, probably coming from the north before moving on to India - beginning a trend of nomads of various stripes conquering the region and then moving on.
The first significant historical empire to conquer and hold Afghanistan was Archaemenid Persia, which controlled the region for around 200 years before the conquests of Alexander the Great. After Alexander's brief rule, the region passed through the control of several Hellenistic successor states, punctuated by invasion by the India Maurya Empire before reverting to the rule of the Persian (or Persianized Central Asian) successor Parthian, Indo-Parthian, Kushan, Sassanid, and Indo-Sassanid states.
After the mid-7th Century CE the region was conquered, lost, and reconquered by a variety of Muslim rulers/states of Arab, Iranian, and Turkic origin, with imperial dynasties indigenous to what would become Afghanistan themselves emerging at this time from the regions around Balkh, Herat, and - most notably - Ghazna.
The Mongols first took the region in 1219 CE, and for the next 500 years the Mongols and their successor (including the Timurids and Mughals) controlled portions of modern Afghanistan, often alongside Persian (Safavid, etc) and other (Turkic, etc) Central Asian rulers.
The modern idea of an Afghan state arguably began with the Durrani Empire after Nadir Shah threw an invading Afghan dynasty out of Iran and then invaded Afghanistan, only to be driven out by a coalition led by Ahmad Shah Durrani, who would go on to conquer large portions of Iran, Central Asia, and Mughal North India. The Duranni Empire was the high-point of Afghan expansion in modern times, and though it would quickly lose much of its overseas territories Afghanistan has not been successfully invaded and held by a foreign power for a prolonged period since.
I found this book to be a good introduction to the topic, though its scope is limited by its national focus.