He was allegedly descended from Ali ibn Abi Talib and the Prophet, Sayyid Ajall's father was Kamāl al-Dīn and his grandfather was Shams al-Dīn 'Umar al-Bukhārī.[7] According to Marshall Broomhall, Shams al-Din, "who was a native of Bokhara, is said to have been a descendant of Mohammed (twenty-seventh generation)."[8] Sayyid participated in Mongke Khan's conquest of Sichuan and was in charge of logistics.[9] He served the court of the Yuan dynasty at Yanjing (modern day Beijing).[10] Later, he was in charge of Imperial finances in 1259,[11] sent to Yunnan by Kublai Khan after conquering the Kingdom of Dali in 1274.