Muhammad himself conferred the title of Pashtun upon Qais and his people according to the tradition. They returned to Ghor to spread Islam and pledged loyalty to Mahmud. Per Ni'matullah, the Ghurid ruler Mu'izz al-Din had initiated their eastward migration into present-day north-west Pakistan, in course of his military campaigns. The Arabs, at war with the Kabul Shah, had directed their campaigns in direction of Gandhara. By the time of Muawiya, Sistan's governorship was separated from Khorasan, with the governor looking after the region and keeping a check on Kabul Shah. Ahmed Hassan Dani considers that the Arab activities may have led to conversion of Aghans as well, and it may have been wholesale because of their tribal nature, i.e., all the Afghan tribes adopted Islam at once. Quoting Matla-al-Anwar, Ferishta states that a man named Khalid, son of Abdullah, stated by some to be a descendant of Khalid bin Walid or Abu Jahl, was for some time governor of Herat, Ghor, Gharjistan and Kabul. After being relieved of the charge, he settled in Koh Sulaiman, with the Lodis and Suris being the descendant of his daughter who married a converted Afghan. Al-Utbi in Tarikh-i-Yamini states that the Afghans were enlisted by Sabuktigin and also Mahmud. During this period, the Afghan habitat was in the Sulaiman Mountains. After defeating Jayapala in 988 AD, Sabuktigin had acquired the territory between Laghman and Peshawar. Al-Utbi states that the Afghans and Khaljis, living there as nomads, took the oath of allegiance to him and were recruited into his army. Iqtidar Husain Siddiqui citing a 13th-century Persian translation, claims he mentions the "Afghans" were pagans given to rapine and rapacity, they were defeated and converted to Islam. Writing in the 11th century AD, Al-Biruni in his Tarikh al Hind stated that the Afghan tribes lived in mountains west of India. He notes, "In the western frontier mountains of India there live various tribes of the Afghans and extend up to the neighbourhood of the Sindu valley." He earlier also noted about the mountains, "In marching from our country to Sindh we start from the country of Nimroz, i.e. the country of Sijistan, whilst marching to Hind or India proper we start from the side of Kabul... In the mountains which form the frontier of India towards the west there are tribes of the Hindus, or of people near akin to them — rebellious savage