of supreme commander of the armed forces and created him the Prince of Lu, a title soon changed to Prince of Yong. He and his staff were sent to rendezvous with Tang and ally Huige forces at Shan Prefecture (陝州, in modern Sanmenxia, Henan), to prepare an attack to recapture the eastern capital Luoyang, which was then serving as the Yan capital under Yan's fourth and final emperor Shi Chaoyi. When Li Kuo met Huige's Dengli Khan Yaoluoge Yidijian (), he treated Yaoluoge Yidijian as an equal, drawing Yaoluoge Yidijian's anger (as Tang was highly reliant on Huige aid at that time). Yaoluoge Yidijian had Li Kuo's Yao Ziang (), Wei Ju (), Wei Shaohua (), and Li Jin () arrested and whipped severely, such that Wei Ju and Wei Shaohua died that night. Yaoluoge Yidijian did not harm Li Kuo, but sent him back to the Tang camp. This incident would cause Li Kuo to bear great hatred for Huige later. After Luoyang was recaptured and Shi Chaoyi committed suicide in flight in 763, Li Kuo was given the chancellor title of Shangshu Ling (), and his portrait, along with those of eight generals (including Guo Ziyi), were added to the Portraits at Lingyan Pavilion. Subsequently, during a Tufan incursion in 763 in which Emperor Daizong was forced to flee Chang'an and Tufan forces briefly captured Chang'an, Li Kuo was named the titular supreme commander of forces in the Guanzhong region (i.e., the Chang'an region), but the general Guo Ziyi, as deputy supreme commander, was actually in command. As crown prince In 764, Li Kuo was made crown prince. Emperor Daizong then tried to transfer his title of Shangshu Ling to Guo Ziyi, but Guo declined on the basis that only Li Kuo had held the title recently, and previously the title had been held by Emperor Taizong. Meanwhile, in 765, a Buddhist nun named Guangcheng () claimed to be Li Kuo's mother Consort Shen, but after further interrogation, it was discovered that she had only been Li Kuo's wet nurse, and Emperor Daizong had her whipped to death. Li Kuo's activities as crown prince were not much recorded in the official histories—although, in 778, after Emperor Daizong executed the corrupt chancellor Yuan Zai, he stated to his close associate Li Mi that it was Li Kuo who revealed Yuan's corruption. In 779, when Emperor Daizong fell ill, Li