king Alutar on the throne. The Chinese sent 10,000 troops under Zhang Xiaosong to Ferghana. He defeated Alutar and the Arab occupation force at Namangan and reinstalled Ikhshid on the throne. Islamic invasions During the 8th century, Fergana was the location of fierce rivalry between Tang dynasty China and the expansion of Muslim power. The Umayyads waged several wars against the Sogdian and Turkic population. They were defeated by the Turgesh who came dominated the Ferghana Valley until their defeat by Tang in 750. At the same time, the Abbasids defeated the Umayyads and sent their forces to Central Asia. This was leading to the Battle of Talas in 751, which resulted in a victory for the Abbasids and the disengagement of China from Central Asia. Two antecedent battles in 715 and 717 had seen the Chinese prevail over Arab forces. A series of Arab, Persian, and later Turkic Muslim rulers reigned over the Fergana. Samanid, Karakhanid and Khwarezmid rules The Samanid Empire, rising from the Arab Muslim conquest of Persia, pushed into what was then called Greater Khorasan, including Transoxiana and the Fergana Valley from the West. In 819, Ahmad ibn Asad—son of Asad ibn Saman—was granted authority over the city of Fergana by Caliph Al-Ma'mun's governor of Khorasan, Ghassan ibn 'Abbad, as a reward for his support against the rebel Rafi' ibn Laith. Following the death of his brother Nuh, who ruled in Samarkand, Ahmad and another brother Yahya were given rule over the city by Abdallah, the governor of Khurasan. By the time of Ahmad's death in 864 or 865, he was the ruler of most of Transoxiana, Bukhara and Khwarazm. Samarkand and Fergana went to his son, Nasr I of Samanid, leading to a series of Samanid Dynasty Muslim rulers of the valley. During demise of Samanids in 10th century, Fergana Valley was conquered by Karakhanids. Eastern part of Fergana later was under suzerenaity of Karakhitays. Karakhanid rule lasted till 1212, when Khwarezmshahs conquered the western part of the valley. Mongol–Turkic rule Mongol ruler Genghis Khan invaded Transoxiana and Fergana in 1219 during his conquest of Khwarazm. Before his death in 1227, he assigned the lands of Western Central Asia to his second son Chagatai, and this region became known as the Chagatai Khanate. But it was not long before Transoxian Turkic leaders ruled the area, along with most of central Asia as fiefs from the