quality:correction, linguistic:voice_change, structural:summarization
Early settlers–Qing dynasty

The region known as the Taipei Basin was home to Ketagalan tribes before the eighteenth century. Han Chinese colonists from Dabu County, Yongding County, Anxi and Tong'an of Southern Fujian began to settle in the Taipei Basin in 1709.

In the late 19th century, the Taipei area, where the major Han Chinese settlements in northern Taiwan and one of the designated overseas trade ports, Tamsui, were located, gained economic importance due to the booming overseas trade, especially that of tea export. In 1875, the northern part of Taiwan was separated from Taiwan Prefecture and incorporated into the new Taipeh Prefecture as a new administrative entity of the Qing dynasty. Having been established adjoining the flourishing townships of Bangka, Dalongdong, and Twatutia, the new prefectural capital was known as Chengnei (Chinese: 城內; pinyin: chéngnèi; Pe̍h-ōe-jī: siâⁿ-lāi), "the inner city", and government buildings were erected there. From 1875 until the beginning of Japanese rule in 1895, Taipei was part of Tamsui County of Taipeh Prefecture and the prefectural capital.

In 1885, as work commenced to govern the island as a province, Taipeh was thus temporarily designated as a provincial capital. The city officially became the capital in 1894. Nowadays, all that remains from the historical period is the north gate. The west gate and city walls were demolished by the Japanese while the south gate, little south gate, and east gate were extensively modified by the Kuomintang and have lost much of their original character.