(Later that year, Wang defeated Li, causing Li to flee west and surrender to Emperor Gaozu of Tang (Li Yuan), a former Sui general who had rebelled in 617 and established Tang Dynasty in spring 618, although he was eventually killed by Tang forces after attempting to reestablish his independence.)