Nizami arrived in Delhi, sometime before the assassination of the Ghurid king Muhammad of Ghor in 1206. Nizami initially stayed with Sharaful-Mulk, who held the office of Sadr in Delhi. When Nizami was looking for employment, his friends suggested that he compile a history of the Muslim conquest of India, highlighting the achievements of Qutb al-Din Aibak.