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.
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.
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.