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 built four batteries in Penghu in 1887, including the Xiyu Western Battery. The battery was inscribed by Li Hongzhang. Xiyu Western Fort was important in delaying Japanese attacks during the Japanese invasion of Taiwan in 1895 but was abandoned during Japanese rule.