Nanzhao

Nanzhao are a Sino-Tibetan kingdom that existed southern China and Southeast Asia during the 8th and 9th centuries. It was centered in Yunnan, China.
History.
Most Nanzhao were Bai people. They spoke Nuosu ("Yi"), a Tibeto-Burman language related to Burmese. They descended from the Cuan clan. The Cuan migrated from Taiyuan to Yunnan during Zhuge Liang's Southern Campaign in 225. By the fourth century they controlled Yunnan.
In 593, they rebelled against the Sui dynasty. But in 602 the Sui destroyed the rebellion. The Cuan split into two groups: the Black and White Mywa.
The White Mywa tribes lived near lake Erhai. In 704 the Tubo made these kingdoms into vassals or tributaries.
In 737, the Tang dynasty helped unify the tribes and create a new kingdom called the Nanzhao (南诏 "Southern Zhao"). In 738 the capital was established in Taihe (south of Dali). It was in the Erhai valley; the mountains made it easy to defend; and there was a lot of farmland.
Tubo alliance.
In 750 the Nanzhao attacked the Tang. In 751 Tang governor of Sichuan, Xianyu Zhongtong then attacked Nanzhao with an army of 80,000 soldiers. He was defeated by Duan Jianwei (段俭魏).
In 754, the Tang sent another 100,000 soldiers, led by General Li Mi (李宓), but never made it past Mu'ege. The Tubo then became friends with the Tubo. This alliance then ended in 794.
Nanzhao attacks on Tang.
In 801 the Nanzhao and Tang defeated Tibetan and their slave Abbasid soldiers. Nanzhao then expanded into Myanmar and conquered Pyu city-states from 820-832.
In 829, the Nanzhao failed to attack Chengdu (Sichuan). In the 830s, they conquered Kunlun to the east and Nuwang to the south.
In 846, 859, 863, the Nanzhao attacked Annam (Vietnam, then part of the Tang). In 869, the Nanzhao again failed to capture Chengdu.
In 873, the Yang family of Shanxi kicked the Nanzhao were out of Sichuan. In 877 the Yang kicked them out of Guizhou. The Nanzhao retreated to Yunnan, and they slowly died. In 902, their chief minister murdered most of the royal family, including the heir apparent. In 937, Duan Siping seized power and created the Dali Kingdom.
They were Buddhists.
They were Vajrayana Buddhists. Many people living in Yunnan still are.
They called it . Azhali is a bit different from Han Buddhist schools like Zen (Chan Buddhism). But it has Han, Tibetan, and Burmese influences. Nanzhao likely had strong religious connections with the (Myanmar), Tibet, and Bengal ().
It was started around 821-824 by an Indian monk from India called Candragupta (赞陀崛多, Zantuojueduo). More monks from India arrived in 825 and 828 and helped build a temple in .
The last king of Nanzhao made Buddhism the official religion.