Dali and the Nanzhao Kingdom
The idyllic scenery belies Dali's importance as the center of power for the Nanzhao Kingdom. The easily defensible area around Erhai Lake was the kingdom's birthplace, which began as the Bai- and Yi-dominated Damengguo in 649. Almost a century later, Damengguo was expanded to include the six surrounding kingdoms ruled by powerful Bai families. This expansion was supported by the ruling Chinese Tang Dynasty, and the kingdom was renamed Nanzhao.
The primarily Buddhist Nanzhao Kingdom was essentially a vassal state of the Tang Dynasty until AD 750, when it rebelled. Tang armies were sent in 751 and 754 to suppress the insurgents, but they suffered humiliating defeats. Emboldened by their victories, Nanzhao troops helped the kingdom acquire a significant amount of territory. Before reaching its high point with the capture of Chengdu and Sichuan in 829, the Nanzhao Kingdom had expanded to include all of present-day Yunnan, as well as parts of present-day Burma, Laos, and Thailand.
Although the capture of Chengdu was a major victory for Nanzhao, it appears to have led directly to its decline. The Tang Dynasty couldn't stand for such an incursion and sent large numbers of troops to the area. They eventually evicted Nanzhao forces from Sichuan by 873. About 30 years later the Nanzhao leaders were finally overthrown, ending the story of their meteoric rise and fall.