According to the tomb tablet of Cuan Longyan, they were descended from a famous official in
Shanxi, however it was common at the time to create fictitious lineages linking indigenous elites back to China, and it's also highly likely that the Cuans were originally native to Yunnan. In the 320s, during the Eastern Jin Dynasty, the Cuan clan migrated into Yunnan. In 339, Cuan Chen ((爨琛) established garrisons in Nanzhong (present-day Yunnan and western Guizhou), named himself king and held authority from
Lake Dian, then known as Kunchuan (昆川), forming a local and semi-independent regime alongside the Xie(謝) clan, a chieftain from the Zangke (牂柯) region in present-day Guizhou. In 549, a native from
Ningzhou rose to power. The
Northern Zhou dynasty granted him the title of prefectural governor (刺史) of Southern Ningzhou (南寧州). In contemporary Chinese historical records, the polity was called "Xicuan guo" (Western Cuan State). The Cuan sent tribute to Northern Zhou and the
Sui dynasty. However Cuan power was broken in 597 and 602 when the Sui invaded. Cuan surrendered to the Sui and was executed but the Sui did not set up direct rule over the region. After Cuan Zan died, the Cuan were split between two rulers, Cuan Wan and Cuan Zhen. The son of Cuan Wan was later sent home by
Emperor Taizong of Tang and made the prefect of Kunzhou (
Kunzhou) The Cuan were divided in half between the east, known as the Wuman/Black Mywa (烏蠻), and the west, known as the Baiman/White Mywa (白蠻). In 737, Piluoge of the Wuman tribe, Mengshe, united the Wuman tribes and founded
Nanzhao (南詔). In 618, the
Tang dynasty assigned Duan Lun as Commander-in-Chief (
zongguan) to Yizhou (
Chengdu). Cuan Hongda, Wan's son, was assigned to Kunzhou as prefect. Duan sent his subordinate, Yu Dashi, into Hongda's territory to persuade local tribes to give their allegiance to the Tang. Western Cuan was the first to pledge allegiance. In 621, a Tang official, Ji Hongwei, arrived in Nanning (
Qujing) and won over more tribes. Some 30
jimi prefectures were created. However exorbitant taxation of the local population caused them to rebel. Duan sentenced them all to death. He was removed from power and transferred back to the capital. After Hongda died, the local chieftains requested the prefectures return to hereditary rule. ==Rulers==