In 416, Yao Xing went to the vacation palace at Huayin (), and he had Yao Hong formally serve as regent at Chang'an and stay in the palace. Yao Xing grew gravely ill at Huayin, however, and was on the way back to Chang'an when his attendant Yin Chong (), a conspirator with Yao Bi, planned to assassinate Yao Hong when he comes out of the palace to welcome his father. Yao Hong's associates, however, heard rumors of the plot and persuaded him not to come out of the palace. Yin Chong's assistant Yao Shami () then suggested to Yin that they deliver Yao Xing to Yao Bi's home and start a rebellion there, but Yin hesitated and did not carry this suggestion out. As soon as Yao Xing returned to the palace, he ordered that Yao Bi's home be searched and that all weapons be seized. When Yao Yin () the Duke of Nanyang, another brother who was in alliance with Yao Bi, then attacked the palace with Yin Chong, planning to put Yao Bi on the throne, Yao Xing publicly ordered that Yao Bi be forced to commit suicide, causing Yao Yin's force to collapse. The next day, Yao Xing, after entrusting Yao Hong to his brother Yao Shao () the Duke of Dongping, Liang Xi, Yin Zhao, and Lian Manwei (), died. Yao Hong initially did not announce news of Yao Xing's death, but did so only after executing Yao Yin and Yao Bi's other associates—including Lü Long the Duke of Jiankang and the former prince of Later Liang, and Yin Yuan (). Yao Hong then took the throne and, not using the secondary imperial title that his father had used ("Heavenly Prince" ("Tian Wang")), directly claimed imperial title.