Alliance with Liu Kun In 316, Shi Le sent his nephew
Shi Hu to attack the Administrator of
Wei Commandery,
Liu Yan. Pidi sent Wenyang to rescue Liu Yan, and while the commandery fell, Liu Yan was safely retrieved. Later that year, the Inspector of Bingzhou, Liu Kun lost his province to Shi Le. Liu Kun was left with nowhere to go, so Pidi sent a letter to invite him to his base. Liu Kun took what was left of his army to meet with Pidi and the two men quickly became friends. Forming a brotherly bond, Pidi and Liu Kun arranged their relatives to marry one another to further cement their friendship. The next year, Pidi and Liu Kun swore an oath of alliance by smearing their lips with blood. Afterwards, they sent their respective envoys to deliver a joint petition urging Sima Rui to claim the imperial title. Liu Kun chose his nephew
Wen Jiao to deliver the petition, while Pidi chose his Chief Clerk of the Left, Rong Shao (榮卲). After their envoys reached the southern capital, Pidi proclaimed Liu Kun as Grand Commander. In 317, he and Liu Kun planned to launch a campaign against Shi Le from Gu'an (固安; southwest of present-day
Langfang,
Hebei) and attempted to persuade Jilujuan into joining forces. However, at the advice of Duan Mobo, Jilujuan did not respond, and so the campaign was aborted.
Arrest and execution of Liu Kun Jilujuan died in early 318 and was succeeded by his uncle,
Duan Shefuchen. Pidi left Ji to attend his funeral but without his knowledge, Duan Mobo manipulated Shefuchen into believing that Pidi was about to usurp his power. At
Zuobeiping, Shefuchen attacked Pidi but was betrayed by Mobo who assassinated him while his and Pidi's forces were fighting. Mobo then took command of the assault and routed Pidi. During this, Mobo capturing Liu Kun's son Liu Qun (劉群), who was escorting Pidi to the funeral. Mobo treated Liu Qun well and considered supporting Liu Kun into becoming the new Inspector of Youzhou. He had Liu Qun write a letter to his father asking him to work as an agent within Pidi's camp, but his envoy was caught by Pidi's scouts along the way. Liu Kun knew nothing of the letter when Pidi confronted him with it. Pidi did not suspect Liu Kun, and Liu Kun himself assured him that he had no intentions to betray Pidi. Pidi let him off at first, but his younger brother, Duan Shujun (段叔軍), was able to get his brother to reconsider his actions. Pidi quickly had Liu Kun arrested. Liu Kun's son, Liu Zun (劉遵), upon hearing his father's arrest, mounted a defence in his camp but was defeated by Pidi. Two of Liu Kun's generals, Pilü Song (辟閭嵩) and Han Ju (韓據), also planned to retaliate, but Pidi had the conspirators executed after their plot leaked. On 22 June, with consent from Sima Rui's general,
Wang Dun, Pidi claimed that he had received an imperial edict to arrest Liu Kun and subsequently executed him along with his four sons and nephews via strangulation. Although Liu Kun had long helped the Jin in attempting to restore its authority in the north, Sima Rui refused to punish Duan Pidi and forbid anyone from mourning Liu Kun, as he and most of the court saw Pidi as a powerful and valuable asset. Despite Sima Rui's leniency, Pidi had underestimated Liu Kun's popularity, and the breaking of his oath caused many of the Han Chinese and
Hu people to lose their trust in him. == Alliance with Shao Xu ==