 After the Kaidu–Kublai war (1268–1301) between the Yuan and Chagatai Khanate (led by Kaidu), most of Xinjiang was controlled by the Chagatai Khanate (1225–1340s).This lasted until the mid-14th century, when Chagatai split into the Western Chagatai Khanate (1340s–1370) and Moghulistan (1340s–1680s), also called the Eastern Chagatai Khanate.Buddhism survived in Uyghurstan (Turfan and Qocho) during the Ming dynasty (1368 to 1644).