After the demise of Nanzhao 南诏, the Buddhist kingdom that integrated the tribes of the Erhai region in the second half of the first millennium, local strongmen proclaimed a succession of short-lived statelets before Duan Siping 段思平 in 937 CE established the Dali Kingdom 大理国.
Nanzhao 南诏 emerged from competing tribes under leadership of the Meng clan 蒙氏 in the second half of the first millennium and after 255 years came to an end when its last, still adolescent, ruler was killed by a courtier in 902 CE.
A large part of what we know about the period of 35 years after Nanzhao's end comes from a Ming dynasty history compilation called《南诏野史》 ('Unofficial History of Nanzhao'). It records the end of Nanzhao with this sentence :
按:蒙氏南诏大蒙国,自细奴逻禅立,起唐太宗己酉贞观二十三年,讫昭宗壬戌天复二年,传十三世,共二百五十五年。
(Rough translation: The Meng clan Nanzhao Great Meng Kingdom, established by Xinuluo, from its founding in the 23rd year of the reign of Tang Taizong to its end in the second year of Zhaozong, a succession of thirteen generations, altogether 255 years.)
Contemporary mainland Chinese historians, in the usual Marxist pattern, attribute the decline of Nanzhao to its 'internal contradictions', which in their opinion led to an increased reliance on Buddhism and increasing warfare to keep the state alive (see 段玉明: 《南诏大理文化史》). Non-mainland scholars, such as Bin Yang take a more cautions approach, noting that Nanzhao's conflict with the Chinese empire probably contributed to demise of the Tang dynasty, which indicates strength rather than weakness of Nanzhao.
But the few records in the 南诏野史 do not give much detail about the state of affairs in the late Nanzhao period, and it seems that it was the conflict between influential clans that led to one clan after the next claim the throne, only to be deposed by another clan shortly after.
In the following, the quotes all come from the section of the 'Unofficial History of Nanzhao' about the period after the fall of the kingdom. The quotes form a successive narrative, that is to say, that what appears in the quotes below is all that is recorded about these statelets.
In 902 CE, the Nanzhao 'Prime Minister' 清平官 Zheng Maisi 郑买嗣 killed the last regent of Nanzhao and proclaimed a new kingdom, called 大长和国. While this brought Nanzhao formally to an end, it seems that apart from a change in rulers not much changed in the region: new temples continued to be established and the warfare against neighbouring states continued:
大长和国传三世
仁旻,后梁太祖庚午开平四年即位,年二十二岁。明年,改元始元,又改元天瑞、景星、安和、贞佑、初历。末帝甲戌干化三年,旻攻蜀。蜀高祖王建发兵拒之,旻兵大败,溺水使者万馀人。后唐庄宗癸未(开)[同]光元年,施宫寺灾,僧智照撰‘封民三宝记’。同光二年旻以朱鬃白马求婚于南汉刘䶮,䶮以增城公主妻之。明宗丙戌天成元年八月,仁旻饵金丹,躁怒,常杀人,遂暴卒,在位十六年,子隆亶立。
郑买嗣又名。伪谥圣明文武威德桓皇帝
郑买嗣,又名,唐巂州西泸令陷南诏臣蒙氏,为清平官郑回之七世孙。隆舜时历官侍中,权势日重。隆舜巡幸无度,留买嗣守国,遂专政柄。舜化贞时为相,化贞卒,嗣贼杀其子,篡蒙国,于唐昭宗壬戌天复二年十二月即位,年四十二岁,国号大长和,仍都大理。明年,建元安国。后梁太祖开平丁卯元年,建普明寺。开平三年,铸佛一万尊,送寺祈福,为杀蒙氏八百人故也。开平四年八月,买嗣卒,在位八年,子仁旻立。 仁旻伪谥肃文太上皇帝
隆亶伪谥恭惠帝
隆亶,后唐明宗丙戌天成元年即位,年十二岁,明年,改元天应。明宗戊子天成三年,东川节度使杨干贞入朝,弑隆亶而立赵善政,计亶在位二年。
按:郑氏大长和国,自买嗣篡位,起唐昭宗癸亥天复三年,讫后唐明宗戊子天成三年,传三世,共二十六年。
In 927 CE, a mere three generations and 26 years later, the last ruler of the Zheng clan Zheng Longmai 郑隆卖 was assassinated by the military commander 节度使 of Jianchuan, Yang Ganzhen 杨干贞. The Yang clan (with their names written in Chinese as 杨, 阳 or 羊) was from early on one of the influential clans in the Dali region, being mentioned many times in official documents.
But it was not the Yang clan who took power after the fall of 大长和国, it was the Zhao 赵 clan under the leadership of Zhao Shanzheng 赵善政, who had been 'prime minister' 清平官 under the previous ruler. In 927 CE, a new kingdom called 大天兴国 was proclaimed. The previous ruling clan was annihilated, but the Yang clan retained its power, who after only ten months deposed the Zhao clan. The 'Unofficial History of Nanzhao' records:
大天兴国一作兴源国。一世
赵善政伪谥悼康帝
赵善政,后唐明宗戊子天圣三年,为东川节度使杨干贞所立。改国号曰大天兴国,建元尊圣。善政宁北佉逸塝人。微时樵于山中,倦卧。梦神告曰:“柴有矣!”觉而果得柴数十束,后告其母,母不信,间一日母潜往山中,果然。及仕郑氏,为清平官,出行途中,天坠一石于前,石裂,有“善政为天子”五赤字。于是杨干贞奇之,乃弑隆亶而拥立焉。明宗己丑天成四年,善政待干贞,恩礼寖衰,凡干贞所有请乞,辄不许。干贞恃功怨望,遂赂结诸臣,废善政而自立。善政在位仅十月。
But even though Zhao Shanzheng's rule lasted not even a year, he and his extended family became Benzhu, Bai protector deities, in a number of villages in the Erhai region, for details see 《白族本主》.
In 929 CE Yang Ganzhen 杨干贞 proclaimed yet another kingdom, called 大义宁国. Legend has it that he was an illegitimate child, born at the Shamo Temple 沙漠庙 near modern Wase and later adopted by someone from Wocun 萂村, receiving military training etc before rising in the court of 大天兴国. 杨周伟's 《朝圣魂归: 南诏大理国》 fleshes this story out somewhat more, giving more credence to the legend that he was an illegitimate child of a ruler.
大义宁国一世
杨干贞伪谥肃恭帝
杨干贞于后唐明宗己丑天成四年夺大天兴国赵善政之位,改国号曰大义宁国,建元兴圣,又改元大命。干贞萂村人。今大理府宾川州所属地。母名弥录,有美色,蒙隆舜私焉。有孕,适渔人杨氏,生干贞,后又生诏。其父捕鱼,贞立船头,见水中有人龙衣冠冕,左右有凤鸟,白光拥护,乃呼父视之。父见是贞之影,大奇之。长仕郑氏,官至东川节度使。至是夺善政位而自立。贞在位,贪暴特甚,中外咸怨。后晋高祖丁酉天复二年,通海节度使段思平起兵讨之。贞遣弟杨诏等五人出拒。诏兵败,干贞出奔。思平遂得位,寻赦其罪,废为僧。计贞在位八年。
Yang Ganzhen's rule also did not last, but his legacy lives on in local patron saint worship. The village of Wocun, in Binchuan county, but actually not far from the shores of Erhai, considers him its patron saint. He is honoured annually in the 天子会 in village during the end of the spring festival period.
In 936 CE, the military commander of the Tonghai region, Duan Siping 段思平 dispatched troops to dispose the Yang clan and in 937 CE proclaimed the new Dali Kingdom 大理国, which was to last until 1254 when the Mongol army invaded Dali and brought hundreds of years of mostly independent rule in the Erhai region to an end.
Based on the little available details from the 《南诏野史》, there is little to suggest that the demise of Nanzhao is anything other than the result of a coup d'etat in the royal household, where a strong 'prime minister' got rid of the young king with the view to install himself as ruler. This in turn then emboldened other clans to do likewise, resulting in this succession of statelets, before the chief of the Duan clan 段氏, which possibly came from outside, manages to install his clan to rule for the next few hundred years.