Historically, Taipei has always been a place where cultures collide and coalesce. The earliest archaeological evidence of human presence in Taipei was found in the Yuanshan Prehistoric Site (B.C. 5000) and the Zhishanyan Prehistoric Site (B.C. 1000-200). The two sites confirm the early human presence in Taipei and Taipei's past as a lake. Later, the Ketagalan group belonging to the Pingpu ("Plains") aboriginal tribes began to thrive in areas such as Danshui, Beitou and Bali.
The Spanish arrived in Danshui from Keelung and built Fort Provintia (now known as the Hongmao Fort, or "red-topped tower" (red hair castle?). Shortly after, the Dutch invaded south Taiwan and fought for control of the island with Ming Dynasty general Koxinga, who was then stationed in Tainan. After defeating Koxinga’s forces, the Qing government assumed total control of Taiwan.
Southern Chinese immigrants from Quanzhou, Zhangzhou, and Canton began to arrive in Mengjia, then Taiwan's largest port, in search of arable land. They fought constantly with the Pingpu tribe as well as among themselves for territory. These early immigrants built houses and temples that reflected a number of regional architectural styles.
Construction of Taipei City was completed in the late 19th century during Emperor Guangxu's reign. The historical city gates that we see today were constructed during this period.
Taiwan became a Japanese colony in 1895, after China lost the First Sino-Japanese War. Taiwan remained a Japanese colony until the end of WWII, when the mainland Chinese Nationalist government took over. The influx of Nationalist troops and personnel brought with them mainland Chinese culture to Taiwanese society.
In recent years, increased immigration from Southeast Asia has further contributed to Taipei's ever more diversified cultural climate.