Tianbao War
The Tianbao War occurred between Nanzhao and Tang China in the 8th century.
Background
In 649, the chieftain of the Mengshe tribe, Xinuluo, founded the Great Meng and took the title of Qijia Wang. He acknowledged Tang suzerainty. In the year 737 AD, Xinuluo's son Piluoge united the Six Zhaos in succession, establishing a new kingdom called Nanzhao. In 738, the Tang granted Piluoge the Chinese-style name Meng Guiyi and the title of "Prince of Yunnan".Piluoge died in 748, succeeded by his son Geluofeng. Geluofeng and his wife once visited Tang officials, but the Yunnan governor Zhang Qiantuo treated them rudely. Zhang also levied unreasonable taxes on them, but Geluofeng mostly refused to pay. Zhang then sent his subordinates to insult Geluofeng, and falsely accused him of treason to the Tang court. Geluofeng was thus resentful and planned to revolt.
War
In 750, Geluofeng raised an army to capture 32 native counties of Yunnan and killed Zhang Qiantuo. Yang Guozhong, the Tang governor of Xichuan, sent Xianyu Zhongtong to lead 60,000 troops to attack Nanzhao. Nanzhao was defeated step by step. Geluofeng sent envoys to the Tang dynasty to apologize and request peace with Tang, but the Tang dynasty refused. Nanzhao then turned to Tibet for help. The Tang army advanced close to the Nanzhao capital, but was defeated. Geluofeng thus proclaimed himself Eastern Emperor and became the sworn younger brother of Tibetan Emperor Mé Aktsom, no longer loyal to the Tang dynasty.In 754, Tang general Li Mi led an army of 70,000 to attack Nanzhao. When they reached the capital, Geluofeng stayed in the city and refused to fight. Li Mi's army ran out of food, and most soldiers died of disease, malaria, and hunger. Li Mi led the rest of his troops back, but was pursued by Nanzhao-Tibetan coalition forces, and his entire army was wiped out. Li Mi himself committed suicide by jumping into the river. After this defeat, the Tang dynasty no longer had the strength to attack Nanzhao.