The Tang Dynasty was relatively weak when it was first established, although the Tang Dynasty destroyed the Sui Dynasty at that time, but there were many forces at that time, the Tang Dynasty had to solve these forces, because to solve these forces, so for the foreign Tang Dynasty is able to tolerate it, basically to seek peace with them, at that time the strongest foreign forces were the Eastern Turks, the Tang Dynasty's forces at that time were really not the opponents of the Eastern Turks, if you really want to fight hard, the Tang Dynasty is very dangerous, so it is only three or four in front of the Turks. After Li Shimin became emperor, he naturally wanted to change this situation.
At that time, Li Shimin had only been on the throne for a month when the Jieli Khan of the Eastern Turks wanted to take this opportunity to attack the Tang Dynasty, when he led more than 100,000 troops to attack the Tang Dynasty, at that time it was directly to the edge of the Weishui River, you must know that the Weishui is only forty miles away from Chang'an, which is very dangerous for Chang'an, at that time, the Jieli Khan felt that Li Shimin had just ascended the throne and did not dare to resist, and the Jieli Khan sent emissaries to Chang'an to threaten Li Shimin, saying that their million-strong army was coming soon. After hearing this, Li Shimin was not afraid at all.

At that time, Li Shimin was very angry, so he directly left the emissaries sent by Jieli, and then he began to deploy his army to prepare to meet the army of Jieli Khan, when Li Shimin was with several generals, he went to the Edge of the Weishui River and confronted the Turkic army across the river, Li Shimin then let Jieli come out to negotiate, Jieli saw that Li Shimin was so bold, and the Tang army seemed to be very well prepared and the morale was still very sufficient, so he came out to negotiate with Li Shimin, and Li Shimin rebuked Jieli Khan for treachery at that time. Didn't you talk about not invading the Tang Dynasty before, and the Tang Dynasty gave a lot of gold and silver treasures to the Turks every year.
Jieli Khan was then counted by Li Shimin and knew that he was in a state of loss, so he agreed to Li Shimin's negotiations, this time the Tang Dynasty and the Turks were successful in peace talks again, after the success of the peace talks, Jieli naturally returned with the army, this crisis is to make Li Shimin deeply aware that the Tang Dynasty must quickly become strong, if not strong such things will happen frequently, so Li Shimin is determined to make the army stronger, then Li Shimin began to pay more attention to military training. He even directly let hundreds of soldiers train in front of the main hall every day, and while training, he also encouraged the soldiers, saying that although the Tang Dynasty has been established now, there are still very many enemies around it, and it is impossible to relax for a moment, once it is relaxed, it will certainly not be able to resist the enemy's attack, now we will train every day, I will also practice with everyone when I have time, and when I fight, I will go to the battlefield with you and resist the enemy with you, and we will definitely be able to defeat the enemy.
The generals were encouraged by Li Shimin's morale was suddenly high, so the training was even harder, so after several years of continuous training, the combat strength was greatly improved, an elite army was trained, at this time the national strength of the Tang Dynasty was also stronger, just when the north where the Turks were located encountered natural disasters and heavy snow, so the grass was frozen to death, without the grass, the Turks' cattle and sheep naturally had no grass to eat, so at that time their cattle and sheep starved to death, and the food on which the Turks depended for their survival was cattle and sheep. Without cattle and sheep they would be equivalent to having no food, so there would definitely be a great famine, and if they did not eat, they would certainly begin to exploit some of the tribes under them, and the tribes below them would not eat, so they naturally rose up to resist.
At that time, Jieli Khan sent his brothers to quell the rebellion of those tribes, but there were too many tribes that resisted, so the soldiers sent to quell them lost the battle, and Jieli Khan reprimanded his brother fiercely at that time, and let people beat his brother a board, which made his brother feel very uncomfortable, and immediately broke with Jieli, and the brother of Jieli Khan went directly to the Tang Dynasty, which was a great good thing for the Tang Dynasty, and what he wanted was a problem within the Turks. Now turkic internal troubles are constant that certainly cannot be missed.
At that time, Li Shimin ordered Li Jing and Xu Shixun and several other generals to attack Jieli Khan, Li Jing was very brave in fighting, and he was very good at using soldiers, he took a few thousand elite soldiers to raid the camp of Jieli Khan, at that time, Jieli Khan's army did not have any defenses at all, this was confused in the face of the sudden Tang army, so it was chaotic, because it was at night that everyone could not figure out the situation, so Jieli Khan could only flee with the army. Later, Li Shimin sent Li Jing to pursue Jieli Khan, and finally defeated Jieli Khan, so the Eastern Turks were completely defeated, and the Tang Dynasty no longer had to be angry with the Eastern Turks.