The Wikipedia has a good article (as of mid-2019) about the Battle of Talas.
This was a battle fought by a Tang Dynasty army operating in the far west (modern day Kazakhstan) in the year 751 A.D. They were fighting against an army from the newly formed Abbasid Caliphate. The Tang army was defeated and the Tang did not return to this part of central Asia, because of the massive disruption caused by the An Lushan revolt which began four years later.
For a thousand years, the Chinese stayed east of Transoxiana (as the region is called).
Eventually, the Chinese reasserted their power against the Khans of this region, starting with the campaigns of the Kangzi Emperor against the Dzungar Khanate (in 1687). The Dzungar were eventually annihilated by the Qing army under the Qianlong Emperor’s direction in 1758.
Further reading: China Marches West: The Qing Conquest of Central Eurasia, 1600-1800 by Peter Perdue.