Emperor Yang's original name was Yang Ying, but was renamed by his father, after consulting with oracles, to Yang Guang. Yang Guang was made the Prince of Jin after Emperor Wen established Sui Dynasty in 581. In 588, he was granted command of the five armies that invaded the southern Chen dynasty and was widely praised for the success of this campaign. These military achievements, as well as his machinations against his older brother Yang Yong, led to him becoming crown prince in 600. After the death of his father in 604, generally considered, though unproven, by most traditional historians to be a murder ordered by Yang Guang, he ascended the throne as Emperor Yang.
Emperor Yang, ruling from 604 to 618, committed to several large construction projects, most notably the completion of the Grand Canal. He commanded the reconstruction of the Great Wall, a project which took the lives of nearly six million workers. He also ordered several military expeditions that brought Sui to its greatest territorial extent, one of which, the conquest of Champa in what is now central and southern Vietnam, resulted in the death of thousands of Sui soldiers from malaria. These expeditions, along with a series of disastrous campaigns against Goguryeo (one of the three kingdoms of Korea), left the empire bankrupt and a populace in revolt. With northern China in turmoil, Emperor Yang spent his last days in Jiangdu (江都, in modern Yangzhou, Jiangsu), where he was eventually strangled in a coup led by his general Yuwen Huaji.
Despite his accomplishments, Emperor Yang was generally considered by traditional historians to be one of the worst tyrants in Chinese history and the reason for the Sui Dynasty's relatively short rule. His failed campaigns against Goguryeo, and the conscriptions levied to man them, coupled with increased taxation to finance these wars and civil unrest as a result of this taxation ultimately led to the downfall of the dynasty.
Yang Guang was born in 569, during the reign of Emperor Wu of Northern Zhou. His parents were Yang Jian the Duke of Sui and Yang Jian's wife Duchess Dugu Qieluo. He was their second son, after Yang Yong, and he had at least one older sister, Yang Lihua, who became the wife of Emperor Wu's crown prince Yuwen Yun (the later Emperor Xuan) in 573. He was considered handsome and intelligent in his youth, and of Yang Jian's and Duchess Dugu's sons, they favored him the most. Sometime during Northern Zhou, on account of Yang Jian's achievements, he was created the Duke of Yanmen.
In 580, Yang Jian seized power as regent after Emperor Xuan's death. In 581, he had Emperor Xuan's son (by the concubine Zhu Manyue), Emperor Jing, yield the throne to him, ending Northern Zhou and establishing Sui Dynasty as its Emperor Wen. Emperor Wen created Yang Yong crown prince and created his other sons imperial princes. Yang Guang thus received the title of Prince of Jin.