In the 17th century, Chinese Ming Dynasty loyalist general Chen Guoxuan () built 15 batteries in Penghu to guard against Qing dynasty admiral Shi Lang. Many of the batteries were destroyed during the Sino-French War of 1884 and 1885, when Penghu was one of the main theaters of conflict. Following the war, Qing governor of Taiwan Liu Mingchuan ordered four batteries built in Penghu in 1887. Xiyu Eastern Fort was constructed in 1889 during Qing Dynasty rule of Taiwan. It was constructed to consolidate the coastal area of Penghu.