China. However, Jangsu was able to use the political situation in China by manipulating the northern and southern Chinese states to his advantage. After the fall of Later Yan, Han Chinese drove the Xianbei Murong clan northward and established Northern Yan in its place. However, Northern Yan's existence was threatened by the powerful Xianbei Tuoba clan of Northern Wei to the west, compelling Northern Yan to make an alliance with Goguryeo, its neighbor to the east. Hence, Jangsu turned his military ambitions southward toward the Korean peninsula. The southern Chinese dynasty of Liu Song, which was feuding with Northern Wei, encouraged both Northern Yan and Goguryeo to oppose Northern Wei. However, Liu Song's plan did not work out, as Goguryeo imprisoned the emperor of Northern Yan in 438. The Liu Song court was outraged and warned Jangsu that the death of the Northern Yan ruler would lead to war. However, Jangsu ignored the threat and executed him, bringing the short-lived Northern Yan dynasty to an end. Liu Song troops then attacked Goguryeo but were easily defeated. Peace resumed in the following year when Jangsu sent 800 horses as a gift to the Liu Song emperor, to aid him in his ongoing war against Northern Wei, allowing Goguryeo to concentrate its forces against Baekje and Silla to the south while Liu Song and Northern Wei were occupied against each other to the west. Jangsu again encouraged Liu Song to invade Northern Wei in 459 when he sent loads of crossbows and provided gold and silver. The Northern Wei government was upset by Jangsu's actions but had to keep peace with Goguryeo to continue its war against Liu Song and the Rouran Khaganate. Jangsu also maintained contact with Northern Wei, and the two empires established a formal relationship in 435. This relationship proved to be useful when Goguryeo waged war against Baekje, which had secretly sought a military alliance with Northern Wei against Goguryeo, because Northern Wei did not interfere in the matters of the Korean countries. In 479, Jangsu established friendly relations with the Rouran Khaganate with a view to keeping Northern Wei under control. After securing peace with the Rourans, Jangsu invaded the Khitans, a branch of the Xianbei confederacy at the time, and then attacked the Didouyu with his Rouran allies. After the Khitans surrendered to Goguryeo, Jangsu sent gifts to both Northern Wei and Southern Qi, which took