Yang Xingmi (; 852Spring and Autumn Annals of the Ten Kingdoms, vol. 1. – December 24, 905Academia Sinica Chinese-Western Calendar Converter.Zizhi Tongjian, vol. 265.), né Yang Xingmin (楊行愍, name changed 886), courtesy name Huayuan (), formally Prince Wuzhong of Wu (吳武忠王, "martial and faithful"),Yang Xingmi's title of Wang (王) is translatable in English as either "prince" or "king." It will be largely translated as "prince" here as he made no attempt to claim his domain to be a state independent from Tang dynasty, and it was not until the time of his son Yang Longyan (King Xuan), by which time the Tang imperial line had long been extinguished, that the Wu state formally declared itself independent, that the Wu rulers claimed the title of Guowang (lit., "state prince/king"). However, "king" will be used for the posthumous honors that Yang Longyan bestowed on him as Yang Longyan was then claiming the Guowang title. See Zizhi Tongjian, vol. 270. later posthumously honored King Xiaowu of Wu (吳孝武王, "filial and martial") then Emperor Wu of Wu () with the temple name of Taizu (), was a Chinese military general, monarch, and politician. He was the military governor (jiedushi) of Huainan Circuit (淮南, headquartered in modern Yangzhou, Jiangsu) late in the Chinese Tang dynasty, whose takeover of Huainan and several nearby circuits allowed him and his family to rule over territory that would eventually become the Five Dynasties and Ten Kingdoms state Wu (although Yang Xingmi would be the first ruler in his line to receive the title of Prince of Wu, it was a Tang-bestowed title and did not denote independence of the state), including most of modern Jiangsu and Anhui and parts of modern Jiangxi and Hubei.

Background Yang Xingmin was born in 852, during the reign of Emperor Xuānzong of Tang. He was from Lu Prefecture (廬州, in modern Hefei, Anhui). His ancestors, including his father Yang Fu (), were farmers for generations. In youth, Tian Jun and he became close friends, and they came to refer to each other as brother.Zizhi Tongjian, vol. 264. It was said that he was physically strong in his youth, and during the Qianfu era (874–879) of Emperor Xuānzong's grandson Emperor Xizong, Yang Xingmin became a bandit. He was captured, but the prefect of Lu Prefecture, Zheng Qi, was impressed by his appearance, and stated to him, "You will be rich and honored one day. Why be a bandit?" Zheng then released him. Yang later became a soldier of the Lu Prefecture militia, and he distinguished himself in battles. However, as a result, his commander was apprehensive of him, and persuaded then-prefect Lang Youfu () to send Yang on an away mission. When Yang subsequently met his commander to bid farewell, and the commander, wanting to pretend to favor Yang, asked Yang what favors Yang would want him to do, if any; Yang responded, "I need your head!" and then killed him. Yang then took control of the militia and declared himself the commander. Lang was unable to control him, and so submitted a report to Gao Pian the military governor (jiedushi) of Huainan Circuit, which Lu Prefecture belonged to, recommending that Gao commission Yang the new prefect to replace Lang himself. Gao agreed, and Emperor Xizong subsequently, at Gao's recommendation, issued such a commission.Zizhi Tongjian, vol. 255.

As prefect of Lu Prefecture Also in 883, two of Gao Pian's officers, Yu Gongchu () and Yao Guiili (), failed in an assassination attempt against Gao's favored sorcerer Lü Yongzhi, who had in effect taken over Huainan's governance due to Gao's trust in him. Lü thus made accusations against them, and Gao sent them out to combat agrarian rebels. Lü then secretly informed Yang (falsely) that Yu and Yao's intent was to attack Lu Prefecture. Yang responded by laying an ambush for Yu and Yao, killing them, and then informing Gao that they had planned a mutiny. Gao, not knowing that Lü put this incident into motion, rewarded Yang for putting down the "mutiny."

In 884, when Gao's nephew Gao Yu (), then the prefect of nearby Shu Prefecture (舒州, in modern Anqing, Anhui), came under the attack of the local agrarian rebel Chen Ru (), Gao Yu sought aid from Yang. Yang did not have enough soldiers to respond, but sent his officer Li Shenfu, who tricked Chen into believing that a large army was arriving from Lu. As a result, Chen fled. Subsequently, when Qin Zongquan, who was previously the Tang military governor of Fengguo Circuit (奉國, headquartered in modern Zhumadian, Henan) but who had rebelled against Tang by this point, sent a brother to attack Lu, Yang sent Tian Jun to repel Qin's attack. Meanwhile, when other agrarian rebels Wu Jiong () and Li Ben () attacked Shu, Gao Yu abandoned it (and was subsequently executed by Gao Pian). Yang then sent his officers Tao Ya () and Zhang Xun () to attack Wu and Li; after Tao and Zhang subsequently captured and executed Wu and Li, Yang commissioned Tao as the prefect of Shu.

In 886 — by which point the prefects of Huainan appeared to be attacking each other at will to enlarge their spheres of influence — Zhang Ao () the prefect of Shou Prefecture (壽州, in modern Lu'an, Anhui) sent his officer Wei Qian () to attack Lu. Yang sent Tian, Li Shenfu, and Zhang Xun to resist, and they repelled Wei's attack. Meanwhile, though, Xu Qing () the prefect of Chú Prefecture (滁洲, in modern Chuzhou, Anhui) attacked Shu; Tao was unable to resist, and fled back to Lu, allowing Xu to take Shu. Also in 886, under Gao's order, for reasons unclear, Yang changed his name from Xingmin to Xingmi.Zizhi Tongjian, vol. 256.

War for control of Huainan Circuit

War against Qin Yan and Bi Shiduo

In 887, Gao Pian's officer Bi Shiduo, fearing that Lü Yongzhi would have him killed, rebelled and put Huainan's capital Yang Prefecture () under siege. Lü, who then had a fallout with Gao himself (as Gao wanted to compromise with Bi while Lü opposed), sent Yang Xingmi an order in Gao's name requesting that he come to Yang Prefecture's aid. Yang, under the advice of his strategist Yuan Xi (), decided to act. He gathered his own forces and requested additional forces from Sun Duan () the prefect of neighboring He Prefecture (和州, in modern Chaohu, Anhui), and headed for Yang Prefecture. Before he got there, Lü, with Gao and Gao's nephew Gao Jie () turning against him, already fled Yang Prefecture, and they rendezvoused at Tianchang (天長, in modern Chuzhou), along with Bi's one-time ally Zhang Shenjian (), who had turned against Bi due to Bi's refusal to give him the spoils he wanted. (By this point, Bi, who had received aid from Qin Yan the governor of Xuanshe Circuit (宣歙, headquartered in modern Xuancheng, Anhui), had offered the military governorship to Qin, so he informed Zhang that any division of spoils had to await Qin's decision, drawing Zhang's anger.)Zizhi Tongjian, vol. 257.

Yang Xingmi then took these joint forces and put Yang Prefecture under siege. Qin and Bi initially defended the city against the siege, but their attempts to counterattack were repelled by Yang Xingmi, who inflicted heavy losses on their troops. Meanwhile, under siege, Yang Prefecture was running out of food supplies, leaving to severe famine and cannibalism. (During the siege, Qin put Gao to death, and Yang Xingmi responded by a great display of mourning.) After several months, Yang Xingmi, unable to capture the city, considered withdrawing, but one night, Lü's former subordinate Zhang Shenwei () opened the city gates and allowed Yang Xingmi's forces in. Qin and Bi fled, allowing Yang Xingmi to capture the city. He claimed the title of acting military governor, while putting Lü and several other officers whose loyalty he considered suspect to death, including Zhang Shenjian.

However, by this point, Qin Zongquan's general Sun Ru had arrived in the vicinity, having been sent earlier in the year by Qin Zongquan to vie for control of Huainan Circuit. (When Qin Zongquan subsequently tried to recall Sun, Sun killed Qin Zongquan's brother Qin Zongheng (), who was theoretically the commander of the army, and refused the recall, effectively acting independently from this point on.) Qin Yan and Bi joined forces with Sun, who immediately put up a threatening posture against Yang Xingmi. Yuan believed that with Yang Xingmi's forces worn out by the lengthy siege and the people of Yang Prefecture facing starvation, Yang Xingmi was in no shape to confront Sun. He suggested that Yang Xingmi abandon the city. Yang Xingmi agreed, and he prepared for an evacuation and return to Lu Prefecture, but did not carry it out immediately.

Meanwhile, the Tang imperial government, which was also weary of the developments at Huainan Circuit, had commissioned Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) the military governor of Huainan as well. Zhu announced that he was making Yang Xingmi deputy military governor, while announcing his own officer Li Fan () as acting military governor. He sent his advisor Zhang Yanfan () to Yang Prefecture to convey his good will and decisions to Yang Xingmi. Yang Xingmi initially welcomed Zhang, but upon hearing that Zhu was sending Li Fan as acting military governor, turned angry. Zhang, in fear, fled back to Xuanwu. Meanwhile, Li Fan, on his way south, was ambushed by Shi Pu the military governor of Ganhua Circuit (感化, headquartered in modern Xuzhou, Jiangsu), who was angry that Zhu, not he, was given Huainan. With both Yang Xingmi and Shi turning against him, Zhu abandoned his plans of taking control of Huainan. He subsequently recommended to the imperial government that Yang be made acting military governor. In spring 888, Sun (who by this point had put Qin Yan and Bi to death and taken over their forces) finally attacked Yang Prefecture, capturing it easily. Sun claimed the title of military governor. Yang Xingmi fled, and per Yuan's suggestion, returned to Lu Prefecture to prepare his next step.

War against Sun Ru