section_path: History/Early colonial period (to 1683)
section_name: Early colonial period (to 1683)
paragraph_text: Early colonial period (to 1683)
  
  The Penghu Islands were inhabited by Han Chinese fishermen by 1171, and in 1225 Penghu was attached to Jinjiang. The Yuan dynasty officially incorporated Penghu under the jurisdiction of Tong'an County in 1281. Penghu was evacuated in the 15th century by the Ming dynasty as part of their maritime ban, which lasted until the late 16th century. In 1349, Wang Dayuan provided the first written account of a visit to Taiwan. By the 1590s, a small number of Chinese from Fujian had started cultivating land in southwestern Taiwan. Some 1,500-2,000 Chinese lived or stayed temporarily on the southern coast of Taiwan, mostly for seasonal fishing but also subsistence farming and trading, by the early 17th century. In 1603, Chen Di visited Taiwan on an anti- wokou expedition and recorded an account of the Taiwanese Indigenous people.
  
  In 1591, Japan sent envoys to deliver a letter requesting tribute relations with Taiwan. They found no leader to deliver the letter to and returned home. In 1609, a Japanese expedition was sent to survey Taiwan. After being attacked by the Indigenous people, they took some prisoners and returned home. In 1616, a Japanese fleet of 13 ships were sent to Taiwan. Due to a storm, only one ship made it there and is presumed to have returned to Japan.
  
  In 1624, the Dutch East India Company (VOC) established Fort Zeelandia on the coastal islet of Tayouan (in modern Tainan). The lowland areas were occupied by 11 Indigenous chiefdoms, some of which fell under Dutch control, including the Kingdom of Middag. When the Dutch arrived, southwestern Taiwan was already frequented by a mostly transient Chinese population numbering close to 1,500. The VOC encouraged Chinese farmers to immigrate and work the lands under Dutch control and by the 1660s, some 30,000 to 50,000 Chinese were living on the island. Most of the farmers cultivated rice for local consumption and sugar for export while some immigrants engaged in deer hunting for export.
  
  In 1626, the Spanish Empire occupied northern Taiwan as a trading base, first at Keelung and in 1628 building Fort Santo Domingo at Tamsui. This colony lasted until 1642, when the last Spanish fortress fell to Dutch forces. The Dutch then marched south, subduing hundreds of villages in the western plains.
  
  Following the fall of the Ming dynasty in Beijing in 1644, Koxinga (Zheng Chenggong) pledged allegiance to the Yongli Emperor and attacked the Qing dynasty along the southeastern coast of China. In 1661, under increasing Qing pressure, he moved his forces from his base in Xiamen to Taiwan, expelling the Dutch the following year. The Dutch retook the northern fortress at Keelung in 1664, but left the island in 1668 in the face of indigenous resistance.
  
  The Zheng regime, known as the Kingdom of Tungning, proclaimed its loyalty to the overthrown Ming, but ruled independently. However, Zheng Jing 's return to China to participate in the Revolt of the Three Feudatories paved the way for the Qing invasion and occupation of Taiwan in 1683.