Around the new year 618, Xue Ju sent Xue Rengao to attack Fufeng Commandery (扶風, also in modern Baoji), but Xue Rengao was blocked by the rebel leaders Li Hongzhi (), who had claimed the title of Emperor of Chu, and Tang Bi (), who had claimed the title of Prince of Tang under Li. Xue Ju sent messengers to persuade Tang to submit, and Tang killed Li and then offered to surrender. Instead, Xue Rengao attacked Tang and seized his troops. Xue Ju then proceeded himself to Fufeng, intending to next attack the Sui capital Chang'an, which had been captured by the Sui general Li Yuan, who declared Emperor Yang's grandson Yang You the Prince of Dai emperor (as Emperor Gong). Li Yuan sent his son Li Shimin against Xue Rengao, and Li Shimin dealt Xue Rengao a major defeat. Xue Ju, in fear, asked his officials, "Since ancient times, were there emperors who surrendered?" Chu Liang () cited the examples of Zhao Tuo, Liu Shan, and Xiao Cong. However, Hao Yuan, by this point serving under Xue Ju, immediately stated: