Mahmud of Ghazni founded the Ghaznavid Empire and ruled as a sultan. He fell in love with Malik Ayaz, a Turkish slave, and their relationship became the epitome of idealized love in Islamic legend and Sufi literature. As the story goes, Ayaz asked Mahmud who the most powerful man in the kingdom was. When the sultan replied that it was himself, Ayaz corrected him, claiming that in fact Ayaz was the most powerful, since Mahmud was his slave. The “slave to a slave” became a favorite trope in Persian literature. R.G.L.
Malik Ayaz, son of Aymáq Abu'n-Najm, was a Turkish slave who rose to the rank of officer and general in the army of Sultan Mahmud of Ghazni (also known as Mahmud Ghaznavi). His rise to power was a reward for the devotion he bore his master.
The love between the first Islamic ruler in the Indian subcontinent Sultan Mahmud of Ghazni and slave Malik Ayaz was such that it became an Islamic legend . Poets praising the power of love looked to Sultan Mahmud as a prime example of the man who , because of the power of his love , became a slave to his slave
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 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 (1596 C.E.). The present Lahore Fort is built in the same location. Under his rulership the city became a cultural and academic center, renowned for poetry. It is said that in old age "Sultán Mahmúd . . . spent his whole time in the society of Malik Ayáz, neglecting the business of the state." The tomb of Malik Ayaz can still be seen in the Rang Mahal commercial area of town.