for next 3 centuries. From their capital in Multan they ruled the far areas of Kashmir. Islam spread rapidly. In the ninth century, the Hindu Shahi dynasty originating from the region of Oddiyana replaced the Taank kingdom in the Punjab, ruling much of Punjab along with eastern Afghanistan. In the 10th century, the tribe of the Gakhars/Khokhars, formed a large part of the Hindu Shahi army according to the Persian historian Firishta. Ghaznavid The Turkic Ghaznavids in the tenth century attacked the regions of Punjab. Multan and Uch were conquered after 3 attacks and Multan's Arab ruler Abul Fateh Daud was defeated, thousands of Ismailis were killed or mutilated according to 11th century scholar Abu Mansur al-Baghdadi, though the community was not extinguished, famous Sun Temple was destroyed. This ended the 3 centuries Arab rule over Punjab. Ghaznavids overthrew the Hindu Shahis and consequently ruled for 157 years, gradually declining as a power until the Ghurid conquests of key Punjab cities of Uch, Multan and Lahore by Muhammad of Ghor in 1186, deposing the last Ghaznavid ruler Khusrau Malik. Following the death of Muhammad of Ghor in 1206, the Ghurid state fragmented and was replaced in northern India by the Delhi Sultanate and for some time independent sultanates ruled by various Sultans. The Delhi Sultanate ruled the Punjab for the next three hundred years, led by five unrelated dynasties, the Mamluks, Khalajis, Tughlaqs, Sayyids and Lodis. Tughlaq Ghiyath al Din Tughlaq, the former governor of Multan and Dipalpur founded Tughlaq dynasty in Delhi and ruled the subcontinent region . Earlier he served as the governor of Multan and fought 28 battles against Mongols from there and saved Punjab and Sindh regions from advances of Mongols and had survived. After his death his son Muhammad Tughlaq became the emperor. Mongol invasion 15th century saw rise of many prominent Muslims from Punjab. Khizr Khan established the Sayyid dynasty, the fourth dynasty of the Delhi Sultanate after the fall of the Tughlaqs.In 1398, Timur attacked the Punjab region. After his invasion, Khizr Khan established the fourth dynasty of the Delhi Sultanate. According to Richard M. Eaton, Khizr Khan was son of a Punjabi chieftain. He was a Khokhar chieftain who travelled to Samarkand and profited from the contacts he made with the Timurid society Later on, Delhi Sultanate, weakened by invasion of Emir Timur, could not control all regions of the Empire and