Prior to the battle, there were other indirect encounters between the combatants. The first occurred in 715 when Alutar, the new king of Ferghana, was installed with the help of the Arabs and Tibetans. The deposed king Ikhshid fled to Kucha (seat of Anxi Protectorate), and sought for Chinese intervention. The Chinese sent 10,000 troops under Zhang Xiaosong to Ferghana. He defeated the Arab-puppet Alutar at Namangan and reinstalled Ikhshid. The inhabitants of three Sogdian cities were massacred as a result of the battle. The second encounter occurred in 717, when Arabs and Tibetans were guided by the Turgesh and besieged two cities in the area of Aksu. The Chinese Tang Jiahui responded by sending two armies, one composed of Karluk mercenaries led by Ashina Xin (client qaghan of Onoq) and another composed of Tang regulars led by Jiahui himself. According to Chinese sources the battle resulted in a Tang victory
Shortly after the battle of Talas, the domestic rebellion of An Lushan (755–63) and subsequent warlordism of the jiedushi (763 onwards) caused the decline of Tang influence in Central Asia by the end of the 700s. The local Tang tributaries then switched to the authority of the Abbasids, Tibetans, or Uighurs and the introduction of Islam was thus facilitated among the Turkic peoples. Well supported by the Abbasids, the Karluks established a state that would be absorbed in the late 9th century by the Kara-Khanid Khanate.
With the successful cooperation of Arabs and Turkic peoples, Islam began to exert its influence on the Turkic culture