
Islam spread into Central Asia during the Abbasid Caliphate, Arabs and local Turkic mostly Uyghur tribes fought together against invading Chinese army (Tang dynasty) in 751 at the Battle of Talas and defeated the Chinese.
This led to trade and communication with Arabs, but however Islam wasn't largely embraced by the Turkic peoples of Central Asia until the reign of Sutuq Bughrakhan of the Qarakhanids, who embraced Islam and made it a state religion in the 900s and subsequently converted other Turkic peoples in his domain to submit to Islam.