An Lushan was of Sogdian and Göktürk origin, at least by adoption. He rose to military prominence by defending the northeastern Tang frontier from the Khitans and other threats. He was summoned to Chang'an, the Tang capital, several times and managed to gain favor with Chancellor Li Linfu and Emperor Xuanzong of Tang. This allowed An Lushan to amass significant military power in northeast China. After the death of Li Linfu, his rivalry with General Geshu Han and Chancellor Yang Guozhong created military tensions within the empire.