During the 320s BCE, Afghanistan and the rest of the Persian Empire were conquered by Alexander the Great and became part of his empire, which empire fragmented after his death in 323 BCE as his generals fought for supremacy. A general named Seleucus carved out the largest Hellenistic kingdom, the Seleucid Empire, which included most of Iran and Afghanistan.
...
By 642 AD, Arabs had conquered Persia and invaded Afghanistan from the west, introducing Islam. Afghanistan at the time had local rulers called the Kushano-Hephthalites or Shahi, which were under the influence of the empire of Tang China, which had extended its influence all the way to Kabul. The Khorasani Persian-Arabs controlled the western and northern areas until they were conquered by the Ghaznavid Empire in 998.
The Arab forces did not conquer all of Afghanistan. The southern and eastern parts of Afghanistan remained independent, first as part of the Kushano-Hephthalite Kingdoms (from 565 to 870 AD), then as part of the Hindu Shahi Kingdom of Gandhara, which lasted until it was conquered by the Muslim Ghaznavid Empire in 1021 AD.
...
Mongol conquest (1200-1500)
Main article: Mongol invasion of Central Asia
Led by Genghis Khan, the invasion resulted in massive slaughter of the population, destruction of many cities, including Herat, Ghazni, and Balkh, and the despoliation of fertile agricultural areas. The country became a part of Mongol Empire. Ghazni was main base for the Mongol campaigns of India. Neguderis settled there under the rule of Chagatai Khans while most of Afghanistan was a part of Ilkhanate. De-facto of Chagatai Khanate Tamerlane, incorporated what is today Afghanistan into his own vast Asian empire. Babur, a descendant of Timur and the founder of Moghul Empire at the beginning of the 16th century, made Kabul the capital.
...
Afghanistan was divided from the 16th to the early 18th centuries. In the North were the Uzbeks, the west was under Safavid Persia's rule and the east was ruled by the Mughals and local Pashtun rule. In 1706, the Afghans (Pashstuns), led by Mirwais Khan Hotak decided to rise against the Persian Safavids. The Persians were expelled. In 1721 Mir Mahmud Hotaki, son of Mirwais led the Afghans in invading Persia. The Persians were defeated in the Battle of Gulnabad. The Afghans captured Isfahan (Iran) in 1722. Mir Mahmud became the Persian Shah. He began a reign of terror against his Persian subjects and was eventually murdered by his own troops. They selected Ashraf Khan as the new Afghan leader. He was able to secure peace with the Ottomans in 1727. However, in the next year, Nadir Shah of Persia launched a national revolt against the Afghan occupiers. He defeated the Afghans in the 1729 Battle of Damghan. Ashraf was killed the next year trying to flee back to Afghanistan. In 1739, Nadir Shah conquered Kandahar, and occupied Ghazni, Kabul and Lahore. After his death in 1747, the Durrani Pashtuns became the principal Afghan rulers. <12>
...
The second Anglo-Afghan war (1878-1880) was sparked by Amir Shir Ali's refusal to accept a British mission in Kabul. This conflict brought Amir Abdur Rahman to the Afghan throne. During his reign (1880-1901), the British and Russians officially established the boundaries of what would become modern Afghanistan. The British retained effective control over Kabul's foreign affairs.
http://en.wikipedia.org/wiki/History_of_Afghanistan