After Tang gaozu was promoted to stay in Taiyuan, some children of Guandong imperial clan took refuge in Tang gaozu in order to escape military service in Liaodong. Some officials in Hedong saw that the Sui Dynasty was gone, and they broke away from the rulers of the Sui Dynasty one after another, constantly persuading Li Yuan to take the opportunity to arise and establish a new dynasty.
In June 6 17, Li Yuan ordered Liu Wenjing to forge the imperial edict of Yang Di, falsely claiming that he would send troops to Taiyuan, Xihe (now Fenyang County, Shanxi Province), Yanmen (now Daixian County, Shanxi Province) and other places, and sent his second sons Li Shimin and Liu Wenjing to recruit soldiers everywhere. They joined forces with the Turkic forces and relied on the strength of the landlord groups in Guanlong and Hedong, calling themselves Emperor Yang Di as the Emperor's Father, and You Yang, who defended Chang 'an, as the Emperor. Then, Tang Gaozu made the eldest son the governor of Zuo Jun and the second son the governor of the right army. He led the recruited "volunteers" to set out from Taiyuan and March into Chang 'an, and his fourth son Yuanji stayed in Taiyuan.
In 6 17 and 6 1 1 year, Li Yuan joined forces with Li and more than 200,000 soldiers and horses to attack Chang 'an. After capturing Chang 'an, Li Yuan felt that the time was not ripe for him to be emperor. As mentioned before, he adopted Yang Gang, the acting king. He claimed to be the king of the Tang Dynasty, commander-in-chief, internal and external military, prime minister and other important positions. As you Yang is only 13 years old, the actual power is still in the hands of Tang Gaozu.
In order to avoid the suspicion of winning the position, Tang Gaozu hinted that his subordinates forced You Yang to give up his seat, and You Yang had to agree.
In the 14th year of Daye (AD 6 18), Li Yuan proclaimed himself emperor, with the title of Tang and Wude. Tang Gaozu is Tang Gaozu. From then on, the history of the prosperous Tang Dynasty began.