Yuwen Huaji

It was said that he often rode strong horses at a high speed through the streets of the capital Chang'an, holding a sling and shooting stones from the sling, and several times, he was removed from his post for receiving bribes, but each time Yang Guang persuaded Emperor Wen to restore him, and Yang Guang gave a daughter (the Princess Nanyang) to Yuwen Huaji's brother Yuwen Shiji in marriage.

Emperor Yang was incensed and ordered that they be executed, but at the last minute spared them, formally awarding them to their father Yuwen Shu as slaves.

In 616, with the northern empire engulfed in agrarian rebellions, Emperor Yang, at Yuwen Shu's suggestion, went to Jiangdu (江都, in modern Yangzhou, Jiangsu).

Emperor Yang, believing that he was well-protected by the elite Xiaoguo Army and not wanting to return to the turbulent north, considered moving the capital to Danyang (丹陽, in modern Nanjing, Jiangsu).

Several Xiaoguo officers—the chief among whom were Sima Dekan (司馬德戡), Pei Qiantong (裴虔通), and Yuan Li (元禮)—planned an organized plot to flee.

A number of high level officials, including the prime minister Yu Shiji, Pei Yun (裴蘊), Lai Hu'er (來護兒), Yuan Chong (袁充), Yuwen Xie (宇文協), Yuwen Jiong (宇文皛), and Xiao Ju (蕭矩) the Duke of Liang (the nephew of Emperor Yang's wife Empress Xiao), were also put to death.

He soon gathered Emperor Yang's court, including his concubines and ladies in waiting, as well as officials, and began heading back northwest, toward the eastern capital Luoyang, leaving the general Chen Leng (陳稜) in charge at Jiangdu.

On the way, the Xiaoguo officers Mai Mengcai (麥孟才), Qian Jie (錢傑), and Shen Guang (沈光) tried to carry out a counter-coup to overthrow Yuwen Huaji and to avenge Emperor Yang, but they only succeeded in killing the co-conspirator Yuan Min (元敏) before they were surrounded and killed.

As Yuwen Huaji approached Luoyang, the rebel leader Li Mi, who controlled the region, resisted him.

Yuwen Huaji initially could not get past Li, and therefore went to and took over Dong Commandery (東郡, roughly modern Anyang, Henan).

In spring 619, Yuwen Huaji attacked Yuan Baozang (元寶藏), a general previously under Li Mi.

However, Dou Jiande the Prince of Xia, another rebel leader intent on attacking Yuwen Huaji, soon arrived, forcing Li Shentong to withdraw.

Dou put Liaocheng under siege as well, and Wang Bo opened the city gates to welcome Xia forces in.

Dou captured Yuwen Huaji and, referring to himself as "your subject" when greeting Empress Xiao, declared a mourning period for Emperor Yang and comforted the Sui officials.