喀喇汗国
In the 10th century, Khotan began a struggle with the Kara-Khanid Khanate, a Turkic state. The Kara-Khanid ruler, Sultan Satuq Bughra Khan, had converted to Islam: