Shortly after Li Shimin ascended the throne, the East Turkistan took advantage of the change of the throne in the Tang Dynasty and the instability of the political power, and led a hundred thousand troops to attack the Tang Dynasty, with soldiers pointing to Chang 'an. Li Shimin sized up the situation and knew that there was no chance for the Turks at this time, so he took appeasement measures against the Turks. On August 8th, the ninth year of Wude, Turkic Li Jiekhan led his troops to the north of Linqiao, and Li Shimin led Gao Shilian and Fang Lingxuan to ride to the south of Lishui Linqiao, where they held talks with Li Jie, accused him of breaking the contract and invading the south, and arranged for the guards of the capital to stand guard in the back, which was magnificent. Jie Li was shocked to see Emperor Taizong's best decission and strong lineup. He also saw that Emperor Taizong promised gold and silk, so he had to make peace. The two sides cut white horses on the temporary bridge to sign a Covenant, and the Turks retreated.
In the fourteenth year of Zhenguan, the forces of Tubo gradually grew, constantly harassing the border of Tang Dynasty and threatening the southwest of Tang King. Li Shimin was deeply disturbed. But he knew that if he sent troops to Tibet at this time, it would inevitably hit the newly established Tang Dynasty again. So he arranged for Princess Wencheng to marry the Tibetan leader. This time, the affinity between the Tang Dynasty and Tibet Tubo brought peace to the border of the Tang Dynasty and stability to the foreign relations of the Tang Dynasty. After Princess Xia Wencheng entered Tibet, she also made a lot of efforts for the relationship between the Tang Dynasty and Tubo. She actively spread Chinese culture, promoted the civilization of Tang society and made outstanding contributions to national integration.
It was Li Shimin's policy of appeasement and pro-nomadism that led to the rule of Zhenguan and the prosperity of Tang Dynasty.