Islamic conquest of Afghanistan

The Islamic conquest of Afghanistan (642–870) began in the middle of the 7th century after the Islamic conquest of Persia was completed, when Arab Muslims defeated the Sassanid Empire at the battles of Walaja, al-Qādisiyyah and Nahavand. The Muslim Arabs then began to move towards the lands east of Persia and in 642 captured the city, Herat. By 667, the Afghan area was under invasion by the Arabs but in 683 Kabul revolted and completely routed the invading army which was led by the Governor of Seistan. It was not until 870 that Kabul and the Afghan area was brought under control by the Saffarids. The near-complete conversion of Afghanistan to Islam was during the period of the Ghaznavids in the 10th century, with Kafiristan holding out until the 1890s.

Caliphate
The invasion of Persia was completed five years after the death of the Prophet Muhammad, and all of the Persian territories came under Arab control, though pockets of tribal resistance continued for centuries in the Afghan territories. During the 7th century, Arab armies made their way into the region of Afghanistan from Khorasan with the new religion of Islam. At this point in time, the area that is currently Afghanistan had a multi-religious population consisting of Hindus, Buddhists, Zoroastrians, Jews, and others.

Kabul Shahis
The area had been under the rule of the Buddhist and then Hindu dynasty called the Kabul Shahis since the 5th century. The Arabs were unable to succeed in converting the population because of constant revolts from the mountain tribes in the Afghan area. The Hindu Shahi were defeated in the early part of the 10th century by Mahmud of Ghazna who ruled between 998 and 1030. He expelled the Hindus from Gandhara. Earlier in 870, Yaqub bin Laith as-Saffar, a local ruler from the Saffarid dynasty of Zaranj, Afghanistan, conquered most of present-day Afghanistan in the name of Islam. In many cases, the people he conquered had rebelled against their Islamic overlords and reverted to prior forms of worship.

From the 8th century to the 9th century, many inhabitants of what is present-day Afghanistan, Pakistan, and areas of northern India were converted to Sunni Islam. It is surmised from the writings of Al Biruni that some Pashtuns living in Pakhtunkhwa (present-day western Pakistan) had not been completely converted. Al Biruni, writing in Tarikh al Hind, also alludes to the Pashtun tribes of Pakhtunkhwa as Hindus.

Various historical sources such as Martin Ewans, E.J. Brill and Farishta have recorded the introduction of Islam to Kabul and other parts of Afghanistan to the invasions of Mahmud of Ghazna

Al-Idirisi (1100-1165/1166) testifies that until as late as the 12th century, a contract of investiture for every Hindu Shahi king was performed at Kabul and that here he was obliged to agree to certain ancient conditions which completed the contract.

During the end of the 9th century, the Samanids extended its rule from Bukhara to as far south as the Indus River and west into most of Persia. Although Arab Muslim intellectual life was still centered in Baghdad, Shi'a Islam, predominated in the Samanid areas at this time. By the mid-10th century, the Samanid Dynasty had crumbled in the face of attacks from Turkish tribes to the north and from the Ghaznavids, a rising Turkic dynasty in Afghanistan.

The region was ruled by Hindu and Buddhist dynasty called the Kabul Shahis since the 5th century. The Arabs were unable to succeed in converting the population of that area because of constant revolts from the mountain tribes. In 870, Ya'qub-i Laith Saffari, a local Persian ruler from the Saffarid dynasty of Zaranj, Afghanistan, conquered most of the cities of present-day Afghanistan in the name of Islam. "Arab armies carrying the banner of Islam came out of the west to defeat the Sasanians in 642 and then they marched with confidence to the east. On the western periphery of the Afghan area the princes of Herat and Seistan gave way to rule by Arab governors but in the east, in the mountains, cities submitted only to rise in revolt and the hastily converted returned to their old beliefs once the armies passed. The harshness and avariciousness of Arab rule produced such unrest, however, that once the waning power of the Caliphate became apparent, native rulers once again established themselves independent. Among these the Saffarids of Seistan shone briefly in the Afghan area. The fanatic founder of this dynasty, the coppersmith’s apprentice Yaqub ibn Layth Saffari, came forth from his capital at Zaranj in 870 and marched through Bost, Kandahar, Ghazni, Kabul, Bamyan, Balkh and Herat, conquering in the name of Islam."

- Nancy Hatch Dupree

During the 8th through the 9th centuries, many inhabitants of what is present-day Afghanistan and western Pakistan were converted to Sunni Islam. In some cases, however, people that were conquered by the Muslims would rebel and revert to prior forms of worship. The mountain areas were still not completely converted and remained largely by people of non-Muslim faiths. In a book called Hudud-al-Alam, written in 982, it mentions a village near Jalalabad, Afghanistan, where the local king used to have many Hindu, Muslim and Afghan wives. "In the eighth and ninth centuries ancestors of many of today's Turkic-speaking Afghans settled in the Hindu Kush area (partly to obtain better grazing land) and began to assimilate much of the culture and language of the Pashtun tribes already present there..."

Ghaznavids and Ghurids
Out of the Samanid dynasty came the Ghaznavids, whose warriors forged the first great Islamic empire from Ghazni (Afghanistan) that spanned much of the Iranian plateau, Central Asia and conducted many successful raids into India. During the end of the 9th century, the Samanids extended its rule from Bukhara to as far south as the Indus River and west into most of Persia. By the mid-10th century, the Samanid dynasty had crumble in the face of attacks from Turkish tribes to the north and from the Ghaznavids, a rising Turkic Muslim dynasty in Afghanistan. Besides Turkic people, large part of the Ghaznavid Empire was made up of local Muslim Afghans from what is now Afghanistan and western parts of Pakistan.

It is surmised from the writings of Al Biruni that some Afghans who lived in west of India (modern-day Afghanistan) had not been completely converted to Islam."The most explicit mentioning of the Afghans appears in Al- Baruni’s Tarikh al hind (11th century). Here it is said that various tribes of Afghans lived in the mountains in the west of India. Al Baruni adds that they were savage people and he describes them as Hindus."

- Willem Vogelsang



"Al Beruni mentions the Afghans once (ed Sachau, I 208) saying that in the western mountains of India live various tribes of Afghans who extend to the neighbourhood of the Sindh (i.e., Indus) valley. Thus in the eleventh century when the Afghans are first mentioned, they are found occupying the Sulaiman Mountains now occupied by their descendants, the very tribes which the advocates of the exclusive claims of the Durannis will not admit to be true Afghans. Al Beruni no doubt also alludes to them in the passage (loc. Cit. p. 199) where he says that rebellious savage races, tribes of Hindus, or akin to them inhabit the mountains which form the frontier of India towards the west."

- H.A. Rose

Various historical sources such as Martin Ewans, E.J. Brill and Farishta have recorded that the complete conversion of Afghanistan, Pakistan to Islam was during the rule of Sultan Mahmud of Ghazni.

"The Arabs advanced through Sistan and conquered Sindh early in the eighth century. Elsewhere however their incursions were no more than temporary, and it was not until the rise of the Saffarid dynasty in the ninth century that the frontiers of Islam effectively reached Ghazni and Kabul. Even then a Hindu dynasty the Hindushahis, held Gandhara and eastern borders. From the tenth century onwards as Persian language and culture continued to spread into Afghanistan, the focus of power shifted to Ghazni, where a Turkish dynasty, who started by ruling the town for the Samanid dynasty of Bokhara, proceeded to create an empire in their own right. The greatest of the Ghaznavids was Mahmud who ruled between 998 and 1030. He expelled the Hindus from Ghandhara, made no fewer than 17 raids into India. He encouraged mass conversions to Islam, in India as well as in Afghanistan."

- Martin Ewans

Al-Idirisi testifies that until as late as the 12th century, a contract of investiture for every Shahi king was performed at Kabul and that here he was obliged to agree to certain ancient conditions which completed the contract. The Ghaznavid military incursions assured the domination of Sunni Islam in what is now Afghanistan and western Pakistan. The most renowned of the dynasty's rulers was Mahmud of Ghazni, who consolidated control over the areas south of the Amu Darya then carried out devastating raids into India. With his booty from India, Mahmud built a great capital at Ghazni, founded universities, and patronized scholars. By the time of his death, Mahmud ruled a vast empire that stretched from Kurdistan to the entire Hindu Kush region as far east as the Punjab as well as territories far north of the Amu Darya. However, as occurred so often in this region, the demise in 1030 of this military genius who had expanded the empire to its farthest reaches was the death knell of the dynasty itself. The rulers of the Ghurids of Ghor in modern-day Afghanistan, captured and burned Ghazni in 1149, just as the Ghaznavids had once conquered Ghor. Not until 1186, however, was the last representative of the Ghaznavids uprooted by the Ghorids from his holdout in Lahore, in the Punjab.