The ancient city was initially called Beiting (Chinese: 北庭; pinyin: Běitíng) or Ting Prefecture (Chinese: 庭州; pinyin: Tíngzhōu), and was the headquarters of the Beiting Protectorate during the 8th century.
The name Beshbalik first appears in history in the description of the events of 713 in the Turkic Kul Tigin inscription.
[3] After the attack, a significant part of the Uyghur Khaganate population fled to the area of the present Jimsar County and Tarim Basin in general in 840,[4] where they founded the Kingdom of Qocho.
[5] Alans were recruited into the Mongol forces with one unit called "Right Alan Guard" which was combined with "recently surrendered" soldiers, Mongols, and Chinese soldiers stationed in the area of the former Kingdom of Qocho and in Besh Balikh the Mongols established a Chinese military colony led by Chinese general Qi Kongzhi (Ch'i Kung-chih).
[6] Due to military struggles between the Chagatai Khanate and the Yuan dynasty during the reign of Kublai Khan, the city was abandoned and lost its prosperity in the late 13th century.