the throne of Ghazni, again defeated Jayapala in his first raid into India (1001), Battle of Peshawar, and in a second expedition defeated Anandpal (1006), both near Peshawar. He also (1024 and 1025) raided the Pashtuns. Over time, Mahmud of Ghazni had pushed further into the subcontinent, as far as east as modern day Agra. During his campaigns, many Hindu temples and Buddhist monasteries had been looted and destroyed, as well as many people being forcibly converted into Islam. Local Pashtun and Dardic tribes converted to Islam, while retaining some of the pre-Islamic Hindu-Buddhist and Animist local traditions such as Pashtunwali. In 1179, Muhammad of Ghor took Peshawar, capturing Lahore from Khusru Malik two years later. Delhi sultanate Following the invasion by the Ghurids, five unrelated heterogeneous dynasties ruled over the Delhi Sultanate sequentially: the Mamluk dynasty (1206–1290), the Khalji dynasty (1290–1320), the Tughlaq dynasty (1320–1414), the Sayyid dynasty (1414–1451), and the Lodi dynasty (1451–1526). Meanwhile, the Pashtuns now appeared as a political factor. At the close of the fourteenth century they were firmly established in their present-day demographics south of Kohat, and in 1451 Bahlol Lodi's accession to the throne of Delhi gave them a dominant position in Northern India. Yusufzai tribes from the Kabul and Jalalabad valleys began migrating to the Valley of Peshawar beginning in the 15th century, and displaced the Swatis of the Bhittani confederation and Dilazak Pashtun tribes across the Indus River to Hazara Division. Early modern history Mughal empire Mughal suzerainty over the Khyber Pakhtunkhwa region was partially established after Babar, the founder of the Mughal Empire, invaded the region in 1505 CE via the Khyber Pass. The Mughal Empire noted the importance of the region as a weak point in their empire's defenses, and determined to hold Peshawar and Kabul at all cost against any threats from the Uzbek Shaybanids. He was forced to retreat westwards to Kabul but returned to defeat the Lodis in July 1526, when he captured Peshawar from Daulat Khan Lodi, though the region was never considered to be fully subjugated to the Mughals. Under the reign of Babar's son, Humayun, a direct Mughal rule was briefly challenged with the rise of the Pashtun Emperor, Sher Shah Suri, who began construction of the famous Grand Trunk Road – which links Kabul, Afghanistan with Chittagong, Bangladesh over 2000 miles to the east. Later, local rulers once again pledged loyalty to