Xueyantuo had been long been a member tribe of the Chile confederation, which had in turn been submissive to Tujue, both before and after Tujue's division into Western Tujue and Eastern Tujue, and in the 600s, the Chile had rebelled against Western Tujue's Heshana Khan Ashina Daman, declaring independence under the leadership of Qibi (契苾) chieftain Geleng (歌楞) (with the title Yiwuzhenmohe Khan (易勿真莫賀可汗)) and the Xueyantuo chieftain Yishibo (with the title Yiedie Khan), but later resubmitted to Western Tujue's Shekui Khan.
At some point, the Chile became submissive to Eastern Tujue instead, and as of the reign of the Jiali Khan Ashina Duobi, the Xueyantuo were ruled by Yishibo's grandson Yi'nan. However, Ashina Duobi was said to be a poor ruler, and by 627, several members of the Chile—Xueyantuo, Huige, and Bayegu (拔野谷) had rebelled. Ashina Duobi tried to send his nephew Ashina Yugu against Huige, but Ashina Yagu was defeated by the Huige chieftain Pusa (菩薩), while Xueyantuo defeated four other Eastern Tujue generals, and Ashina Duobi was not able to resubjugate the Chile rebels. Still, in 628, when these Chile tribes offered the title of khan to Yi'nan, Yi'nan did not initially dare to accept it. However, Emperor Taizong of Tang, hearing this and wanting to establish an alliance with Xueyantuo against Eastern Tujue, sent his general Qiao Shiwang (喬師望) to Xueyantuo to create Yi'nan the Zhenzhupieqie Khan (or Zhenzhu Khan in short), and subsequently, a large number of Chile and Tujue tribes came under Yi'nan's rule. Subsequently, Tang and Xueyantuo often exchanged emissaries, and Xueyantuo grew stronger at Eastern Tujue's expense.
In 629, Emperor Taizong commissioned the general Li Jing to lead a major expedition against Eastern Tujue, and in 630, Li Jing captured Ashina Duobi and effectively destroyed Eastern Tujue. Much of the Eastern Tujue people surrendered to Xueyantuo, and some surrendered to Tang. After this event, Xueyantuo was the predominant power north of China, but remained formally submissive to Tang. In 638, Emperor Taizong, with Yi'nan's concurrence, further created Yi'nan's sons Bazhuo and Jialibi (頡利苾) as subordinate khans under Yi'nan—ostensibly to honor them, but hoping to create dissension between them. In 639, when Emperor Taizong commissioned the general Hou Junji to launch a campaign against Gaochang, Yi'nan offered to attack Gaochang at the same time, although Hou's quick conquest of Gaochang appeared to involve no actual Xueyantuo aid.
Also in 639, however, a Tang action would begin to lead to a deterioration of the relationship between Tang and Xueyantuo. After Ashina Duobi's capture, Emperor Taizong had settled the Eastern Tujue people who surrendered to Tang within Tang borders, without creating a new khan to govern them. However, after he (Emperor Taizong) was nearly assassinated by Ashina Duobi's nephew Ashina Jiesheshuai (阿史那結社率) in 639, Emperor Taizong changed his mind and created an Eastern Tujue prince loyal to Tang, Ashina Simo as Qilibi Khan (not to be confused with Yi'nan's son Qilibi), to serve as the new khan of Eastern Tujue, intending to settle his state south of the Gobi Desert to serve as a buffer between Tang and Xueyantuo. Yi'nan was distressed by the development, but initially indicated that he accepted it.
As of 641, Ashina Simo had finally marched north of the Great Wall and settled in at Dingxiang (定襄, in modern Hohhot, Inner Mongolia). Meanwhile, Yi'nan had heard that Emperor Taizong was about to offer sacrifices to heaven and earth at Mount Tai and, believing that the Tang troops would all be with Emperor Taizong, had his son Dadu (大度) launch a major attack on Eastern Tujue, intending to destroy Ashina Simo before Tang could render aid. Ashina Simo withdrew within the Great Wall and took up position at Shuo Prefecture (朔州, roughly modern Shuozhou, Shanxi) and sought emergency aid from Tang. Emperor Taizong sent the general Li Shiji, assisted by the generals Zhang Jian (張儉), Li Daliang, Zhang Shigui (張士貴), and Li Xiyu (李襲譽), to attack Xueyantuo. Li Shiji engaged Dadu first and defeated him, forcing him to flee. Meanwhile, Yi'nan had sent an emissary to Emperor Taizong to offer peace with Eastern Tujue, and Li Shiji prevailed over Dadu, Emperor Taizong sent the emissary back with a rebuke for Yi'nan but did not further take actions against Xueyantuo, and thereafter, the relationship between Tang and Xueyantuo officially remained that of lord and vassal, but appeared to be no longer as strong as it had been.