As of 618, Shen Faxing was serving as the governor of Wuxing Commandery (), the new name for the Chen's Hu, under Emperor Yang. He was on a campaign against the agrarian rebel leader Lou Shigan () when news came that Emperor Yang had been killed at Jiangdu (, modern Yangzhou, Jiangsu) in a coup led by the general Yuwen Huaji. Shen therefore, claiming that he was attacking Yuwen, gathered the troops of the region (more than 60,000 men), and occupied more than 10 commanderies, including such cities as Yuhang (, in modern Hangzhou, Zhejiang), Piling (, in modern Changzhou, Jiangsu), and Danyang (, in modern Nanjing, Jiangsu). He declared himself the grand commandant of Jiangnan (the lands south of the Yangtze River) and exercised imperial powers.