Kingdom of Dali
Shams al-Din was of Central Asian Iranic origin, being a Muslim Khwarezmian from Bukhara (in present-day Uzbekistan). When Genghis Khan attacked the city during the war between the Khwarizmi Shah and the Mongols, Sayyid Ajall Shams al-Din Omar's family surrendered to him. 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ī. 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)." Sayyid participated in Mongke Khan's conquest of Sichuan and was in charge of logistics. He served the court of the Yuan dynasty at Yanjing (modern day Beijing). Later, he was in charge of Imperial finances in 1259, sent to Yunnan by Kublai Khan after conquering the Kingdom of Dali in 1274. After his death, Sayyid was given the posthumous name Zhongyi (忠懿). Later, the imperial court conferred the title "Prince of Xianyang" (咸陽王) and the posthumous name Zhonghui (忠惠) on him.