At the end of the 7th century, the Umayyad Arabs entered into the area now known as Afghanistan after decisively defeating the Sassanid Empire in Nihawand. Following this colossal defeat, the last Sassanid Emperor, Yazdegerd III, who became a hunted fugitive, fled eastward deep into Central Asia. In pursuing Yazdegerd, the route the Arabs selected to enter the area was from north-eastern Iran and thereafter into Herat where they stationed a large portion of their army before advancing toward eastern Afghanistan. Some Arabs settled in these new areas and married locals while adopting new customs. Other groups and contingents who elected not to settle gradually pushed eastwards but encountered resistance in areas surrounding Bamiyan. When ultimately arriving at Kabul, the Arabs confronted the Kabul Shahan who had built a long defensive wall around the city. The bloodiest war in Kabul was in Chahardihi area where still tombs of Arabs killed in that war exist in DarulAman area. The most famous Arab character killed in that war was Shah-do Shamshira, whose tomb is located near Kabul river in Asmayee st. One of the most famous Commanders who fought against Arab invaders is known as Mazangi. Mazangi was in command at the battle of Asmayee where Shah-Do Shamshira was killed. There is a number sights where Arab invaders fought in Kabul, but the bloodiest battle after Asmayee was the battle of Alwoden in the area known as Darul Aman today. The historical details of this battle remains largely unknown, though the Arabs were nonetheless subdued in the long term. Despite the lack of much written accounts, another famous archaeological legacy of this battle remains standing in Kabul, notably the tomb of the Shah-e Do Shamshira next to the Shah-Do Shamshira Mosque. The site, located near Kabul's market district, was built near the area where an Arab commander died. Following the Arab confrontation, the region was made part of Khorasan with its seat of power in Herat in the west. The Arabs later partially relinquished some of their territorial control though reasserted its authority approximately 50 years later in 750 when the Abbasid caliphs replaced the Ummayads. By then, many Arabs increasingly blended with locals as the Arabic identity in the region began to undergo a significant change. Arab contingents settled throughout various parts of present-day Afghanistan including the Wardak, Logar, Kabul, Balkh and in the Sulaiman Mountains. Over time they adopted local customs and languages, some became Persianized while others became Afghanized who followed Pashtunwali. It was during the reign of the Ya'qub Saffari that Arabic began losing its influence in the region. Nevertheless, the Arabs attempted to re-exert their influence in the area by supporting the Samanid rulers of Balkh who in return, assisted the Abbasid Arabs against the defiant Saffarid dynasty. Despite maintaining some clothing customs and attire, most the early Afghan-Arabs gradually lost their original tongue of Arabic. This is confirmed in the 15th century work, Baburnama, which notes that the Arabs of Afghanistan have virtually lost the Arabic language and instead speak Persian and Pashto language. Although the exact number of Arab-Afghans remains unknown, mostly due to ambiguous claims of descent, an 18th-century academic estimated that they number at approximately 60,000 families.
Second wave
After the Bolshevik Revolution, many Sunni Arabs residing in Bukhara and other areas of Central Asia ruled by Russians migrated to Afghanistan where they were better able to practice their religion without fear of religious persecution or discrimination. One estimate indicated that approximately 30,000 Arabs lived in Bukhara during the mid-nineteenth century. The Arabs who entered into Afghanistan during this time still retained some Arabic in contrast to the Afghan Arabs who came during the first wave. Some Arabs from the second wave intermarried with the local population as they adopted the languages of northern Afghanistan, namely Uzbek, Turkmen, and Persian language. Many settled in Kunduz, Takhar and Sar-e Pol provinces. Currently, while they still view themselves as Arab, all the Arabs from the second wave have, like those from the original wave, lost their language of Arabic, adopting Persian instead. Although some tribal names, including Qureshi and Shaiboni are still remembered, most of the Arabs view genealogies as unimportant. Many of these Afghan Arabs work in the agricultural industry, often growing cotton and wheat while others raise karakul sheep. According to an academic, the Central Asian Arabs have not had any contact with Middle Eastern Arabs since the time of Tamerlane. The main body of the Afghan Arabs are found in Shibarghan provinces. Afghan Arabs, however, are presently all Dari-speaking and have been in their collective memories. However, they claim an Arab identity. There are other such Persian-speaking "Arabs" to the east, between Shebergan, Mazar-i Sharif, Kholm and Kunduz living in pockets. Their self-identification as Arabs is largely based on their tribal identity and may in fact point to the 7th and 8th centuries migration to this and other Central Asian locales of many Arab tribes from Arabia in the wake of the Islamic conquests of the region.
Third wave
During the 1980s Soviet–Afghan War, many Arab Muslims arrived and volunteered to help Afghans fight Soviet Union. Some of these remained after the Soviets withdrew from the country and were granted citizenship. Others intermarried with local Afghans while some arrived with their families to Afghanistan. Kandahar is home to a small Arab cemetery where over 70 graves belong to Arab al-Qaeda functionaries who were killed as a result of the U.S. War on Terror. These Arabs are revered by the Taliban and the Salafist sympathizers as shahid.
Regional groups
Balkh
Around 900 families live in Khoshal Abad and Yakhdan villages of Dawlat Abad district of the province, the villagers can trace their lineage back to the third caliphate of Uthman, in the 7th century. These families are mainly engaged in agriculture and carpet weaving. Most Arabs in Balkh Province, speak in Arabic as their mother tongue, and Dari as a second language. While some of the older generation had never learned to speak either of Afghanistan's two official languages, Dari and Pashto, many of the younger generation were being taught Dari in school and forgetting their Arabic; about 40 percent can no longer speak Arabic. Many of their customs have been forgotten, or are no longer relevant to a younger generation that identifies more with Afghanistan. Arabs who settled in northern Balkh province are worried that their culture is being wiped out as more people adopt the language and traditions of Afghanistan. Arabs form the smaller minorities in the town and district of Kholm; many identify themselves as ethnic Arabs although no one actually speaks Arabic.
Jowzjan
There are about 1,000 families living in Hassanabad of Shebarghan, capital of Jowzjan province, and in Sultan Arigh village of Aqcha district that identify themselves as Arabs. None, however, has spoken Arabic in their collective memory, with Dari forming their native language.