This would explain the relationship of the Khalaj and Ghilzai pretty sufficiently
In 1040, they revolted against Mas'ud I of Ghazni, was sultan of Ghaznavids. He sent a punitive expedition but he was defeated and later dethroned and executed by Mohammad Ghaznavi. During the Ghaznavid and Ghurid rules, some of Khalaj gradually become Ghilzai tribe of Afghan. Ghurid Ghiyath al-Din Mahmud came to power at Firuzkuh with support of them. Later they were subjected by Khwarezmshahs in 1210s. During the Mongol invasion of 1221, many Khalajes joined the Mongols but others continued to Sayf al-Din Ighrak, who formed an ephemeral independent state in the valley of Kabul. Many Khalajes then went to India and served the sultans of Delhi, in western India and even in Bengal, its members were called Khilji and founded a dynasty which ruled Delhi sultanate from 1290 to 1320 and other dynasties in various places as Malwa. Despite their Turkic origins, they were considered as Afghans for Indians.


Comment