In 1659, Liu Guoxuan accompanied Zheng Chenggong to fight south of the
Yangtze River. He also participated in the
siege of Fort Zeelandia. After Zheng Chenggong's death, Liu was deployed around the island by
Zheng Jing, the new ruler. In 1674, Liu took advantage of the
Revolt of the Three Feudatories and attacked the mainland, taking a lot of land. Finally, in 1680, the Three Feudatories were soon-to-be defeated and Zheng Jing's army was defeated in
Fujian. Liu Guoxuan had to rescue and retreat with Zheng Jing back to the
Penghu islands. Liu Guoxuan became allies with
Feng Xifan and together they successfully ousted rival official
Chen Yonghua from the political arena in 1680. After Zheng Jing's death in 1681, they slandered
Zheng Kezang in front of
Queen Dowager Dong. They claimed that Zheng Kezang was not a biological son of Zheng Jing and subsequently they launched a coup to kill Zheng Kezang and seize power. The result of the coup was 12-year-old
Zheng Keshuang taking the throne. He was made the Wuping Marquis (武平侯) in 1681 and was put in charge of the military of Tungning.
The Battle of Penghu In 1683, the Kangxi Emperor sent Admiral
Shi Lang to attack Tungning with about 21,000 men and 238 warships. Liu Guoxuan led the Penghu defense fleet to drive back Shi Lang before a major hurricane struck, which was successful. After the hurricane ended, the forces engaged in battle once again. Liu predicted that the Qing navy would send a small detachment around the battle to land directly on his land base so he had archers and cannons on the beaches along with a detachment of soldiers. Shi Lang's navy took the
Hujing Island and the
Tongpan Island on July 12. During the battle, the Qing navy smashed and broke Liu's formation. Due to the better equipped Qing navy, most of the Tungning fleet was under the ocean within an hour. Liu's fleet surrendered when they had run out of ammunition to continue fighting. Their land base was also taken by many skilled Qing generals. It was said that
Mazu, a Chinese sea goddess personally aided Shi Lang in defeating Liu.
Surrender of Tungning Liu Guoxuan was about to commit suicide when he was stopped by Shi Lang. After a brief talk about the battle, Liu was freed. After the battle, the Tungning royal court split into two factions: the "war" faction and the "surrender" faction. Ruler Zheng Keshuang heeded Liu's advice to surrender. ==Later years and death==