Legend, scattered commentary, and speculations suggest that khayal originated with Amir Khusrau (1251-1326). Born in North India, Amir Khusrau was a poet as well as a composer and a great musician of his time. He enjoyed importance at the courts of the Khilji rulers in Delhi. Khayal's origin may have been attributed to Khusrau because of the rapid fusion of Perso-Arabic and Indic musical systems during his lifetime. After Khusrau, the next prominent figures in the history of khayal are the sultans of Jaunpur - Muhammad Sharqui (1401-40) and Hussain Sharqui (ruled 1458-99), who were contemporaries of Babur, the first Mughal ruler in India. The precise role of the Sharqui sultans with respect to khayal is unclear; some scholars suggest a patronage role for them. Most historians are of the opinion that neither Amir Khusrau nor any of the Sharqui sultans was the innovator of khayal, but that khayal was an outcome of the gradual process of evolution that was at work during an era of Indo-Persian amalgamation.
For khayal, the first musical evidence of court support is noted at the Delhi darbar (court) of the eighteenth century Mughal emperor Muhammad Shah Rangile (ruled 1720-48), where the musicians Nyamat Khan (Sadarang) and Firoz Khan (Adarang) composed songs that have been transmitted to the present time. It is believed that Sadarang and Adarang also formalized the structure of modern day khayal. As khayal continued to evolve in the courts throughout North India, distinct performing styles emerged into different gharanas. Three major khayal gharanas carrying the names of the princely states in which they were originally fostered, are Gwalior, Rampur (Sahaswan) and Patiala. Later Agra, Kirana and Jaipur gharanas also became prominent centers of khayal singing. Today this style of classical vocal music is even adopted by some of the instrumental gharanas such as Ithawa. Throughout most of its existence khayal has always been the music of elite patrons. Only in the twentieth century has any other group attained significant involvement in khayal.