Prince of Qin
In spring 618, Xiaoguo officers nevertheless rose in a coup, led by Yuwen Huaji (Yuwen Shu's son). They killed Emperor Yang and a large number of high-level officials, but as Pei was kind to them, they spared Pei. Yuwen Huaji declared Emperor Yang's nephew Yang Hao the Prince of Qin emperor, and began to head back north with the Xiaoguo Army.