Li Yuan rebelled against Emperor Yang of Sui in 617, and by 618 had established Tang Dynasty as its Emperor Gaozu. He created many of his relatives with nobility titles, Li Daozong was created the Duke of Lüeyang. In 619, a major Tang enemy Liu Wuzhou the Dingyang Khan attacked and captured most of Tang's holdings in modern Shanxi and approached Hedong (, in modern Yuncheng, Shanxi). Li Daozong served under Emperor Gaozu's son Li Shimin the Prince of Qin in resisting Liu, and at his suggestion, Li Shimin did not engage Liu immediately, choosing to wear out Liu's food supplies, eventually allowing Li Shimin to defeat Liu. Further, during the campaign, Li Daozong and Yuwen Shiji were able to persuade Liu's general Yuchi Gong to surrender, and Yuchi later became an important general under Li Shimin.