Liang Shidu entered into an alliance with another rebel leader of the region, Guo Zihe (). In 618, with the Sui general Li Yuan having rebelled against Emperor Yang and entered the capital Chang'an, declaring Emperor Yang's grandson Yang You emperor (as Emperor Gong), another rebel ruler, Xue Ju the Emperor of Qin, entered into an alliance with Liang and Eastern Tujue, seeking to attack Chang'an.
Liang Shidu allied himself with another rebel leader in the area, Guo Zihe (). In 618, after Sui general Li Yuan had risen against Emperor Yang and taken control of Chang'an as emperor Gong, proclaiming Yang You emperor, a rival ruler named Xue Ju of Qin joined forces with Liang and Eastern Tujue to attack Chang'an.