The history of Anping dates back to the 17th century, when the Dutch East India Company occupied Tayuan/Tayoan/Tayouan/Tayowan (transliterated into Chinese characters as 大灣/台員/大員/台圓/大圓/台窩灣), meaning "foreigner" in Sirayan. In the period of the Japanese occupation, the history of trade between China and Japan unfolded at Anping.
Anping was originally a small island separated from the mainland of Tainan until the 19th century. Due to the ocean current, the small lagoon between Anping island and Tainan was silted up and gradually disappeared, and Anping became a part of Tainan.
Fort Zeelandia: When the Dutch occupied Tayoan, they built the first castle in Taiwan called Fort Zeelandia. At that time, it was the centre of politics and trade in Taiwan. Over the years, Fort Zeelandia had several name changes and is currently known as Anping Castle.
Eternal Golden Castle (億載金城 or 二鯤鯓砲台): Eternal Golden Castle or Uhrkuenni Battery was built in 1874 by Shen Baozhen, a Qing Dynasty official. At that time it was used to fend off the Japanese and defend Anping from attack by sea. In 1895, when Japan took over Taiwan, the locals resisted the Japanese's warship from this fortress. During the Russo-Japanese War, the Japanese government sold some of Eternal Golden Castle's guns in order to pay for the war. Afterwards, the fortress lost its military value.