Sima Ying soon ordered Emperor Hui's second wife, Yang Xianrong, and his crown prince Sima Qin, deposed. Then, at Sima Yong's pre-arranged petition, Sima Ying was created the crown prince. He put people he trusted in charge of the defenses of Luoyang, while remotely controlling the government from Yecheng. Eventually, the officials in Luoyang tired of the situation, and they rose under Sima Yue's command in summer 304. Sima Yue, with Emperor Hui accompanying him, then attacked Yecheng. Sima Ying, after some initial hesitation, battled Sima Yue's troops and defeated him, forcing him to flee and capturing Emperor Hui. He did not return Emperor Hui to Luoyang, but kept him at Yecheng.