 In 618 AD, Xue Ju, who occupied Longxi and made Tianshui his capital, styled himself as the Qin emperor ().He possessed an army of 300,000 soldiers and intended to capture Chang'an.In 618 AD, Emperor Gaozu of Tang appointed Li Shimin as the marshal to meet the Qin forces head-on.