Xue Song (薛嵩) (died 773), formally the Prince of Pingyang (平陽王), was a general of the Chinese rebel state Yan, who later submitted to and became a general of Tang Dynasty, from which Yan had rebelled. As was in the case of several other Yan generals who submitted to Tang but who had substantial army and territorial holdings, Xue was allowed to retain his command and territory, semi-independent of the Tang imperial government structure.
It is not known when Xue Song was born, but he was said to be born in the modern Beijing region. His grandfather Xue Rengui was a well-known general during the reign of Emperor Gaozong of Tang, and his father Xue Chuyu (薛楚玉) served as a general as well. Despite Xue Song's coming from a distinguished lineage, it was said that he paid no attention to property management and fell into poverty. It was also said that he was strong and capable in riding and archery, but paid no attention to studies.
During the Anshi Rebellion
When the general An Lushan rose against the rule of Emperor Gaozong's grandson Emperor Xuanzong in 755, Xue Song served An's rebel Yan. The first solid historical reference to him was in 758, when An Lushan's son and successor An Qingxu was besieged by Tang forces in Yecheng and forced to send Xue to seek out aid from his father's old subordinate Shi Siming. Shi eventually did defeat Tang forces and lift the siege at Yecheng, but then killed An Qingxu himself and took over as the emperor of Yan, and it appeared that Xue continued to serve under Shi Siming at that point.
After the Anshi Rebellion
By 763, the Anshi Rebellion had been put down by Tang forces, with Shi Siming's son and successor Shi Chaoyi committing suicide. At that time, Xue was defending Yecheng for Shi Siming, and he, along with several other key Yan generals -- Tian Chengsi, Zhang Zhongzhi, and Li Huaixian—submitted to Tang. The Tang imperial regime, then under the rule of Emperor Xuanzong's son Emperor Suzong, was hesitant to displace them in fear that they would start another rebellion, so at the urging of the general Pugu Huai'en, they were allowed to remain at their current posts, and Xue was made the military governor (jiedushi) of Zhaoyi Circuit (昭義, headquartered in modern Anyang, Henan), controlling the six prefectures around Yecheng.
It was said that Xue governed Zhaoyi Circuit effectively, and that the people were comforted after the lengthy warfare. It was said, however, that he grew increasingly independent of the Tang imperial government, along with Zhang (whose name had been changed to Li Baochen at that point), Tian, Li Huaiyu, Li Huaixian, and Liang Chongyi, each in control of several prefectures. Xue was created the Prince of Gaoping, and later the Prince of Pingyang. He died in 773, and was initially succeeded by his son Xue Ping, who, however, almost immediately gave up the post to Xue Song's brother Xue E. Tian, who controlled the neighboring Weibo Circuit (魏博, headquartered in modern Handan, Hebei), who wanted to expand his territory, then attacked Zhaoyi and forced Xue E to flee. Tian took control of four of the six Zhaoyi prefectures, and the Tang imperial government retained control of the other two, eventually merging it with nearby Zelu Circuit (澤潞, headquartered in modern Changzhi, Shangxi) and maintaining the Zhaoyi name for the merged circuit.