In 396, amidst the war between Later Yan and Northern Wei, Wei troops attacked and killed Yan's Administrator of Guangning (廣寧郡; in present-day Zhangjiakou, Hebei), Liu Kangni (劉亢泥). This prompted Murong Xiang to abandon his post and flee for the Yan capital in Zhongshan. In 397, Northern Wei placed Zhongshan with the Emperor of Yan, Murong Bao, under siege. Just as concerning, Murong Bao's brother, Murong Lin, had rebelled and his whereabouts were unknown. Murong Bao was afraid that Murong Lin was making his way to the pivotal city of Longcheng (龍城, in modern Jinzhou, Liaoning). Therefore, Murong Bao abandoned Zhongshan and brought his army to secure Longcheng.
Members of the Murong clan in Zhongshan left the city, all except for Murong Xiang, who had either not completed his preparations to leave by the time they left or had failed to catch up with them. Left with only themselves to fend off the oncoming Wei onslaught, the people of Zhongshan quickly elected Murong Xiang as their leader.[3] Zhongshan was reluctant to surrender to Wei, as they feared Wei would execute them en masse just like they did to the Yan soldiers after the Battle of Canhe Slope two years prior. Under Murong Xiang, the people of Zhongshan put up a strong defence and prevented Wei from breaching the city.
Later, Murong Bao's party, by chance, discovered Murong Lin along the way to Longcheng, causing Murong Lin to flee to Wangdu. However, once Murong Lin was at Wangdu, Murong Xiang sent an army to attack him. Murong Xiang's army captured Murong Lin's wife and children, but Murong Lin himself escaped to the hills. In May 397, Murong Bao defeated his rebellious son, Murong Hui. Murong Hui fled to Zhongshan, but Murong Xiang had him executed.
As the siege of Zhongshan continued, the Wei army's food supply was running low. The Prince of Wei, Tuoba Gui, ordered his general, Tuoba Yi, to lift his siege of Ye and move to Julu to gather grains at Yangcheng (楊城; in present-day Yi County, Hebei). Murong Xiang used this opportunity to launch an attack with 6,000 infantry on the Wei camps. Tuoba Gui instructed his general, Zhangsun Fei, to feign a retreat. As Murong Xiang pursued Zhangsun Fei, Tuoba Gui attacked his rear and routed him. 5,000 of Murong Xiang's men died, while Tuoba Gui captured 700 others, although he soon pardoned and released them.[4]
Previously, Murong Bao had sent a general named Kunuguan Ji (庫傉官驥) to reinforce Murong Xiang. Kunuguan Ji arrived after Murong Xiang's defeat to Tuoba Gui, but instead of helping each other, fighting ensued between Kunuguan Ji and Murong Xiang. Murong Xiang killed Kunuguan Ji and massacred his clan. Murong Xiang also did the same to the Intendant of Zhongshan, Fu Mo (苻謨), and his family.[5]