sister the Princess Dongping to Qifu Gangui as his princess and created him the Prince of Liang. Qifu Gangui sent his brother Qifu Yizhou (乞伏益州) to aid Fu Deng, but as Fu Deng came out of the mountains to join Qifu Yizhou's forces, Yao Xing ambushed and captured him, and then executed him. Qifu Yizhou then withdrew. Fu Deng's son Fu Chong fled to Huangzhong (湟中, in modern Xining, Qinghai), then under Qifu Gangui's control, and claimed imperial title. However, in winter 394, Qifu Gangui expelled him, and he fled to one of his father's last remaining generals, Yang Ding the Prince of Longxi. Yang led his forces to join Fu Chong's to attack Qifu Gangui. Qifu Gangui sent Qifu Yizhou and two other generals, Qifu Ketan (乞伏軻彈) and Yuezhi Jiegui against Yang and Fu Chong, and Yang was initially successful against Qifu Yizhou. However, the three Western Qin generals then counterattacked and killed Yang and Fu Chong in battle. Around the new year 395, Qifu Gangui claimed the title Prince of Qin—a greater title that implicitly made himself a rival of Later Qin, and the state thus became known in history as Western Qin. In the summer, he sent Qifu Yizhou to attack the unsubmitting Di chief Jiang Ru (姜乳), despite warnings that Qifu Yizhou had become arrogant from his victories. Qifu Yizhou indeed became unattentive and was defeated by Jiang. Later in the year, Qifu Gangui moved his capital from Jincheng to Xicheng (西城, in modern Baiyin, Gansu). In fall 395, Lü Guang made a major attack on Western Qin. Under the advice of his officials Mi Guizhou (密貴周) and Mozhe Gudi (莫者羖羝), Qifu Gangui submitted to Lü Guang as a vassal and sent his son Qifu Chibo (乞伏敕勃) as a hostage to Lü Guang, and Lü Guang withdrew. However, Qifu Gangui soon regretted this arrangement and executed Mi and Mozhe. In 397, determined to punish Qifu Gangui, Lü Guang launched a major attack against Xicheng . This frightened Qifu Gangui's officials enough that they recommended a retreat to Chengji (成紀, in modern Tianshui, Gansu) to the east, but Qifu Gangui, seeing weaknesses in Later Liang's forces despite their numbers, stood his ground. Later Liang forces were initially successful, capturing several major Western Qin cities, but Qifu Gangui tricked Lü Guang's brother and major general Lü Yan (呂延) the Duke of Tianshui into believing that he was retreating,