The early Kyrgyz state reached its greatest expansion after defeating the Uyghur Khaganate in 840 CE. Then Kyrgyz quickly moved as far as the Tian Shan range and maintained their dominance over this territory for about 200 years. In the 12th century, however, the Kyrgyz domination had shrunk to the Altay Range and the Sayan Mountains as a result of the rising Mongol expansion. With the rise of the Mongol Empire in the 13th century, the Kyrgyz migrated south. Plano Carpin, an envoy of the Papal states, and William Rubruck, an envoy of France, all wrote about their life under the Mongols. Various Turkic peoples ruled them until 1685, when they came under the control of the Oirats (Dzungars).