Kingdom of Dali
The Dali Kingdom, known in Chinese as the Dali State, was a medieval kingdom around the Lake Erhai valley in what is now Yunnan, China. Duan Siping established it at Dali in 937 and 22 kings of his dynasty ruled it until 1253, when it was conquered during the Mongol invasion of the area. The invaders received help from the dynasty itself, which continued to rule the area afterwards as Mongol vassals.
The Dali Kingdom was preceded by the Nanzhao dynasty, which was overthrown in 902. Three dynasties followed in quick succession before Duan Siping seized power in 937, establishing himself at Dali.Gao Shengtai forced the puppet king Duan Zhengming to abdicate and become a monk in 1095, and renamed the state "Greater China". He returned the power to Duan Zhengchun and his family upon his death, after which it is also known as the Later Dali.
Han Chinese ancestry was professed by the Duan clan. Their Han ancestors originated from Wuwei in Gansu province 武威段氏.
The 11th king of Nanzhao established Buddhism as the state religion. Ten of the 22 kings of Dali gave up the throne and became monks.
It is claimed that despite their military prowess and superior numbers, the Mongols could not breach the defenses of the Erhai valley, which was so suited to defense that even just a few defenders could hold out for years. It is said that the Mongols found a traitor who led them over the Cang Mountains along a secret path, and only in this way were they able to penetrate and overrun the Bai defenders. Thus ended three centuries of independence. In 1274 the Province of Yunnan was created by the Mongol Empire at the beginning of the Yuan dynasty.
...
Wikipedia