At the start of the period, the Abbasids ruled Bactria (northern Afghanistan), where they allowed the local Buddhists, Hindus, and Zoroastrians to keep their religions if they paid a poll tax. Many, however, voluntarily accepted Islam, especially among the landowners and the educated upper urban classes. Its high culture was more accessible than their own and they could avoid paying the heavy tax. The Turki Shahis, allied with the Tibetans, ruled Kabul, where Buddhism and Hinduism were flourishing. The Buddhist rulers and spiritual leaders might easily have worried that a similar phenomenon, conversion out of convenience, would happen there.

The Turki Shahis ruled the region until 870 CE, losing control of it only between 815 and 819. During those four years, the Abbasid Caliph al-Ma'mun invaded Kabul and forced the ruling shah to submit to him and accept Islam. To represent his submission, the Kabul Shah presented the Caliph, as a gift, a gold Buddha statue from Subahar Monastery. As a sign of the triumph of Islam, Caliph al-Ma'mun sent the enormous statue, with its silver throne and jeweled crown, to Mecca and displayed it there at the Kaaba for two years. In doing so, the caliph was demonstrating his authority to rule the entire Islamic world after vanquishing his brother in a civil war. He did not force all the Buddhists of Kabul to convert, however, nor did he destroy the monasteries. He did not even smash, as an idol, the Buddha statue that the Kabul Shah had presented him, but sent it instead to Mecca as booty. After the Abbasid army withdrew to fight against movements for autonomy in other parts of their empire, the Buddhist monasteries quickly recovered.

The next period in which the Kabul region came under Islamic rule was also short, between 870 and 879 CE. It was conquered by the Saffarid rulers of an autonomous military state, remembered for its harshness and destruction of local cultures. The conquerors sent many Buddhist “idols” back as war trophies to the Abbasid caliph. When the successors to the Turki Shahis, the Hindu Shahis, retook the region, Buddhism and the monasteries once more recovered their previous splendor.

The Turkic Ghaznavids conquered eastern Afghanistan from the Hindu Shahis in 976 CE, but did not destroy the Buddhist monasteries there. As vassals of the Abbasids, the Ghaznavids too were strict followers of Sunni Islam. Although they tolerated Buddhism and Hinduism in eastern Afghanistan, their second ruler, Mahmud of Ghazni, launched a campaign against the Abbasid rivals, the Ismaili state of Multan. Mahmud conquered Multan in 1008 CE, driving the Hindu Shahis from Gandhara and Oddiyana on the way. The Hindu Shahis had allied themselves with Multan. Wherever he conquered, Mahmud looted the wealth from the Hindu temples and Buddhist monasteries, and consolidated his power.

After this victory in Multan, and driven undoubtedly by greed for more land and wealth, Mahmud pressed his invasion further eastward. He conquered the present-day Indian Punjab, known in those days as "Delhi." However, when the Ghaznavid troops pushed northward from Delhi to the foothills of Kashmir, chasing after the remnants of the Hindu Shahis in 1015 or 1021, depending on the sources one uses, they were defeated, purportedly by the use of mantras. This was the first attack on Kashmir attempted by a Muslim army. The Kalachakra description of the future invasion and defeat of the non-Indic forces in Delhi is most likely, then, a conflation of the Multanese threat to the Abbasids and Ghaznavids with the Ghaznavid threat to Kashmir.