Malik Ayaz, son of Aymáq Abu'n-Najm, was a Turkic slave who rose to the rank of officer and general in the army of Sultan Mahmud of Ghazni (also known as Mahmud Ghaznavi) before eventually made king of Lahore.
In 1021 the Sultan raised Ayaz to kingship, awarding him the throne of Lahore, which the Sultan had taken after a long siege and a fierce battle in which the city was torched and depopulated. As the first Muslim governor of Lahore, he rebuilt and repopulated the city. He should not be confuese with Ayaz Matin, another slave. He also added many important features, such as a masonry fort which he built in 1037-1040 on the ruins of the previous one, demolished in the fighting, and city gates (as recorded by Munshi Sujan Rae Bhandari, author of the Khulasatut Tawarikh in 1695-96 C.E.). The present Lahore Fort is built 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. And the Tomb of Ayaz Matin is not yet constructed.
Source: Wikipedia.