In 682 AD, according to
Ferishta, the Afghans of
Peshawar, who had, even at that early period, embraced
Islam, wrested certain possessions from the Hindu prince. A war ensued, and in the space seventy battles were fought with varied success, until the Afghans, having formed an alliance with the
Ghakkars, a wild tribe inhabiting the
Salt Range of Punjab, compelled the Raja to cede a portion of his territory. The next mention of Lahore is in the
Rajputana chronicles, where the
Bussas of Lahore, a
Rajput tribe, are mentioned as rallying to the defence of
Chittore, when besieged by Muslim forces in the beginning of the ninth century.
Ghaznavid Empire (center) receives a robe from Caliph
Al-Qadir; painting by
Rashid-al-Din Hamadani. in
Anarkali,
Lahore,
Pakistan. At length, in 975 AD,
Sultan Sabuktigin, Governor of
Khorassan and father of the celebrated
Sultan Mahmud Ghaznavi advanced beyond the
Indus. He was met by
Raja Jayapala, the
Raja of Lahore whose dominion is said to have extended from
Sirhind to
Laghman and from
Kashmir to
Multan. By the advice of the
Bhati Rajput tribe, the Raja Jayapala formed an alliance with the Afghans, and, with their aid, was enabled to withstand the first invasion. However, Sabuktigin later repeated his conquest on his succession to the throne of
Ghazni. A battle ensued in the vicinity of
Lamghan ending with the defeat of the Raja and overtures being made for peace. His terms were accepted and persons were sent, on the part of Sabuktigin, to take the balance of the stipulated ransom. On reaching Lahore, Jayapala proved faithless and imprisoned those commissioned to receive the treasure. On learning intelligence of his perfidy, Sabuktigin, in the words of the
Ferishta,
"like a foaming torrent, hastened towards Hindustan". Another battles ensued, in which Jaipal was again vanquished, and he retreated, leaving the territory to the west of the Nilab or Indus in the hands of the invader. The invader did not retain the conquests that he had made for in 1008 AD, a confederation headed by
Anandapala, the son of
Raja Jayapala, again met the advancing army, now commanded by Mahmud, son and successor of Sabaktagin, in the vicinity of Peshawar. Lahore was allowed to remain intact for thirteen years longer. Anandapala was succeeded by Nardjanpal, while Mahmud pushed his conquests into Hindustan. But in 1022 AD, he suddenly marched down from Kashmir, seized Lahore without opposition, and gave it over to be plundered. Nardjanpal fled helpless to Ajmer, and the Hindu principality of Lahore was extinguished forever. A final effort was made by the Hindus in the reign of Modud, 1045 AD, to recover their lost sovereignty, but after a fruitless siege of six months, they retired without success. is to the right, shaking the hand of the
Shaikh, with Ayaz standing behind him. The figure to his right is
Shah Abbas I, who reigned about 600 years later. Few references to Lahore exist for times before its capture by
Sultan Mahmud Ghaznavi in the eleventh century. In 1021,
Mahmud appointed
Malik Ayaz to the throne and made Lahore the capital of the
Ghaznavid Empire. The
Sultan Mahmud Ghaznavi took
Lahore after a long siege and battle in which the city was torched and depopulated. As the first Muslim ruler of Lahore, Ayaz rebuilt and repopulated the city. The present Lahore Fort stands in the same location. Under his rule, the city became a cultural and academic center, renowned for poetry. The tomb of Malik Ayaz can still be seen in the Rang Mahal commercial area of town. Lahore was formally made the eastern capital of the Ghaznavid empire in 1152, under the reign of
Khusrau Shah. The city then became the sole capital of the Ghaznavid empire in 1163 after the fall of
Ghazni. The entire city of Lahore during the medieval Ghaznavid era was probably located west of the modern Shah Alami Bazaar, and north of the
Bhatti Gate. When Sultan
Qutb-ud-din Aybak was crowned here in 1206, he became the first
Muslim Sultan of
South Asia. It was not until 1524 that Lahore became part of the
Mughal Empire.
Mamluk In 1187, the
Ghurids invaded Lahore, ending Ghaznavid rule over Lahore. Lahore was made capital of the
Mamluk Dynasty of the
Delhi Sultanate following the assassination of
Muhammad of Ghor in 1206. Under the reign of Mamluk sultan
Qutbu l-Din Aibak, Lahore attracted poets and scholars from as far away as
Turkestan,
Greater Khorasan,
Persia, and
Mesopotamia. Lahore at this time had more poets writing in Persian than any city in Persia or Khorasan. Following the death of Aibak, Lahore came to be disputed among Ghurid officers. The city first came under control of the Governor of
Multan,
Nasir ad-Din Qabacha, before being briefly captured by the sultan of the Mamluks in Delhi,
Iltutmish, in 1217. Lahore governor Malik Ikhtyaruddin Qaraqash fled the Mongols, while the Mongols held the city for a few years under the rule of the Mongol chief
Toghrul. In 1266,
Sultan Balban reconquered Lahore, but in 1287 under the Mongol ruler
Temür Khan,
Mongol invasion and destruction The
Mongols invaded and conquered the
Khwarazmian dynasty, the King
Jalal al-Din Mangburni retreated to modern
Khyber Pakhtunkhwa but was defeated in
Battle of Indus. The Mongol army advanced and in 1241, the ancient city of
Lahore was invaded by 30,000-man cavalry. The Mongols defeated the Lahore governor Malik Ikhtyaruddin Qaraqash, massacred the entire population and the city was leveled to the ground. There are no buildings or monuments in Lahore that predates the
Mongol destruction. In 1266,
Sultan Balban reconquered Lahore from the Mongols but in 1296 to 1305 the Mongols again overran northern
Punjab. In 1298, 200,000 men Mongol army conquered
Punjab and committed atrocities then marched towards Delhi but was defeated by
Malik Kafur general of
Sultan Alauddin Khalji ruler of the
Delhi Sultanate.
Tughluq Lahore briefly flourished again under the reign of
Ghazi Malik of the
Tughluq dynasty between 1320 and 1325, though the city was again sacked in 1329, by
Tarmashirin of the Central Asian
Chagatai Khanate, and then again by the Mongol chief Hülechü. but the city was retaken by Ghazi Malik's son,
Muhammad bin Tughluq. By the time
Tamerlane captured the city in 1398 from Shayka Khokhar, he did not loot it because it was no longer wealthy.
Fall of the Sultanate is one of Lahore's few remaining medieval era buildings. Timur gave control of the Lahore region to
Khizr Khan, Governor of
Multan, who later established the
Sayyid dynasty in 1414 – the fourth dynasty of the
Delhi Sultanate. Lahore was briefly occupied by the
Timurid Governor of Kabul in 1432–33. The last
Lodi ruler,
Sultan Ibrahim Lodi was greatly disliked by his court and subjects. Upon the death of his father
Sultan Sikandar Lodi, he quashed a brief rebellion led by some of his nobles who wanted his younger brother Jalal Khan to be the Sultan. After seizing the throne by having Jalal Khan murdered, he never really did succeed in pacifying his nobles. Subsequently, Daulat Khan, the governor of
Punjab and Alam Khan, his uncle, sent an invitation to Babur, the ruler of
Kabul to invade
Delhi. The
first Battle of Panipat (April 1526) was fought between the forces of
Babur and the Delhi Sultanate. Ibrahim Lodi was killed on the battlefield. By way of superior generalship, vast experience in warfare, effective strategy, and appropriate use of artillery,
Babur won the
First battle of Panipat and subsequently occupied
Agra and
Delhi. == Early Modern era==