The Uygur areas from Hami in the east to Hotan in the south were unified into a greater feudal separatist Kaxgar Khanate after more than two centuries of separatism and feuding from the late 14th century. As the capital was moved to Yarkant, it was also known as the Yarkant Khanate. Its rulers were still the offspring of Jagatai.
During the early Qing period, the Khanate was a tributary of the imperial court and had commercial ties with central China. After periods of unsteady relations with the Ming Dynasty, the links between the Uygurs and ethnic groups in central China became stronger. Gerdan, chief of Dzungaria in northern Xinjiang, toppled the Yarkant Khanate in 1678 and ruled the Uygur area.
The Qing army repelled in 1757 (the 22nd year of the reign of Emperor Qian Long) the separatist rebellion by the Dzungarian nobles instigated by the Russian Tsar, and in 1759 smashed the "Batu Khanate" founded by Poluonidu and Huojishan, the Senior and Junior Khawaja, in a separatist attempt.