<P> The Guangnan West Circuit Fiscal Commissioner, Wang Han (fl. 1043--1063), feared that Nùng Trí Cao's kinsmen Nùng Tông Đán intended to plunder the region after he crossed the Song border in 1057 . Wang Han took a personal visit to Nùng Tông Đán's camp and spoke with Nùng Trí Cao's son, explaining that seeking "Interior Dependency" status would alienate them from the Lý court, but if they remained outside of China proper they could safely act as loyal frontier militia . Wang Han then sent a memorial to Emperor Renzong's (r . 1022--1063) court in 1060, advocating the policy agreed with the Nùng . The Song government rejected his proposal and made the Nùng communities (along with other ethnic groups) official dependents of Song imperial authority, and Nùng Tông Đán's request that the territories under his authority be incorporated into the Song Empire was granted in 1062 . In 1059--six years before the Song court's New Policies under Chancellor Wang Anshi (1021--1086) organized new self - sufficient militia units throughout the empire and along the border with Đại Việt--the Lý dynasty ruler Lý Thánh Tông reorganized northern frontier administrative units and raised new militias . This bolstered his kingdom's strength in a time of conflict with Champa (located in southern Vietnam). </P> <P> In the spring of 1060, Giáp Đồng natives under the frontier prefectural leader Thàn Thiệu Thái--an imperial in - law to the Lý court through marriage alliance--raided the Song frontier for cattle and militia recruits . He succeeded in taking the Song military leader Yang Baocai hostage, and in autumn of 1060 Song troops were sent into the frontier to rescue the general but he was not found . The Song court appointed Yu Jing (余 靖; 1000--1064) as a new military commissioner of the Guangnan region and charged him with the task of quelling the unrest caused by Thàn Thiệu Thái . Yu Jing also sent an agent to Champa to enlist Cham aid against the Song's enemies in Guangnan . </P> <P> The Lý court discovered the Song's secret attempt to ally with Champa; while Lý sent a delegation to Yongzhou to thank Song for putting down local rebellions and to negotiate terms of peace, they instructed their agents to gather intelligence on the alleged Champa alliance and the strength of Song's military presence in the Guangnan Western Circuit . Two Vietnamese envoys were permitted to offer tribute to the court of Renzong in Kaifeng, arriving on February 8, 1063 to deliver gifts, including nine tamed elephants . On March 30, 1063, Emperor Renzong died and was succeeded by Emperor Yingzong (r. 1063--1067); Vietnamese envoys arrived in Kaifeng again to congratulate Yingzong on his ascension, and on April 7, 1063, Yingzong sent gifts such as calligraphy works by Renzong to Vietnamese King Lý Thánh Tông . On the day that the Vietnamese envoy Lý Kế Tiên prepared to depart from Kaifeng back to Đại Việt, news arrived that Thàn Thiệu Thái had raided Song's Guangnan West Circuit again . Although a plea from a Guangnan official urged Kaifeng to take action, Yingzong left defenses up to local Guangnan forces and labeled Thàn Thiệu Thái as "reckless and mad" in an effort to disassociate him from the Lý court . </P> <P> The minor Song official Lu Shen, a prefect in Guizhou, sent a message to Kaifeng in 1065 which reported that Nùng Tông Đán had apparently switched allegiance from Song to Lý, as well as united with the Quảng Nguyên chieftain Lưu Ký . When the now "mentally weak and distracted ruler" Yingzong--as Anderson describes him--received the report, he took no other action but to reassign Nùng Tông Đán with new honorific titles . The court took no action to resolve the problem, and Nùng Tông Đán later played a key role in the Lý--Song War of 1075--1077 . The Song also gave official titles to other Vietnamese leaders despite their involvement in Nùng Trí Cao's rebellions and their pledged loyalty to Lưu Ký, the latter employed as a tribal official under King Lý Thánh Tông . </P>

Who did the song dynasty ally with that led to their demise