A noble of the Sui and a cousin of
隋炀帝 (their mothers were sisters), he was in command at
太原 when he rose in revolt in 617. He took
长安 that winter and declared the Tang in 618. After his son
李世民 killed two of his brothers at the
玄武门之变 in 626, he gave up the throne and lived on as retired emperor.