
The Sui dynasty was an imperial dynasty of China which existed from 581 to 618 AD, with Chang'an serving as its capital. It was founded by Emperor Wen of Sui, who overthrew the Northern Zhou. By 587, Sui crushed and subdued Western Liang before striking south and conquering the Southern Chen by 589. During the Sui dynasty, China was finally united, and the Sui oversaw the creation of the Grand Canal, rebuilt the Great Wall, undertook public works programs, and promoted Buddhism throughout the empire. However, the Sui launched a series of disastrous and costly military campaigns against Goguryeo, breaking Sui power. The Sui ignored floods and famines as they wasted thousands of lives in failed Korean campaigns, leading to agrarian revolts breaking out in 613 AD. The Sui general Li Yuan was sent to Shanxi with an army to defend the capital, and, from 615 to 616, he destroyed local bandit groups and repelled an invasion by the Gokturks. However, rebellion spread across the country, and Li Yuan marched south in 617 AD, besieged Chang'an, and briefly dominated a puppet emperor before deposing the Sui in 618 AD and creating the Tang dynasty.