The Sui dynasties unified China under indigenous Chinese rule for the first time since the end of the Han period, and the Tang inherited this legacy. Yet unlike the Sui emperors, Taizong was of part Turkic ancestry, born and raised on the frontier, so he was intimately familiar with the problem of nomadic raiders who were pressing on the Tang northern borders. By 630 Taizong had defeated the first eastern Türkic nomads and resettled them north of the Ordos in Inner Mongolia.
Other Central Asian peoples and minor kingdoms in northwestern China submitted to the Tang court, naming Taizong and his heirs their "supreme Khan." This brought the important Hexi corridor and Gobi oases under imperial Chinese control, and Taizong enlisted garrisons of Turkic and Central Asian soldiers to protect the trade routes, facilitating a renewed flow of trade goods transported by Central Asian, Indian and Near Eastern merchants, who also brought along with them their religion and their culture.