Taipei City (/tape/; Chinese: or ; pinyin: Tibi Sh; Peh-e-j: Ti-pak Chh) is the capital of the Republic of China (Taiwan). Situated at the northern tip of Taiwan, Taipei is located on the Tamsui River; it is about 25 km (16 mi) southwest of Keelung, a port city on the Pacific Ocean. It lies in the two relatively narrow valleys of the Keelung () and Xindian () rivers, which join to form the Tamsui River along the city's western border. The city proper (Taipei City) is home to an estimated 2,618,772 people. Taipei, New Taipei, and Keelung together form the Taipei metropolitan area with a population of 6,900,273. However, they are administered under different local governing bodies. "Taipei" sometimes refers to the whole metropolitan area, while "Taipei City" refers to the city proper. Taipei City proper is surrounded on all sides by New Taipei.
Taipei is the political, economic, and cultural centre of Taiwan. The National Palace Museum which has one of the largest collections of Chinese artifacts and artworks in the world is located in Taipei. Considered to be a global city, Taipei is part of a major industrial area. Railways, high speed rail, highways, airports, and bus lines connect Taipei with all parts of the island. The city is served by two airports Taipei Songshan and Taiwan Taoyuan.
Taipei was founded in the early 18th century and became an important center for overseas trade in the 19th century. The Qing Dynasty of China made Taipei the provincial capital of Taiwan in 1886. When the Japanese acquired Taiwan in 1895 after the First Sino-Japanese War, they retained Taipei as the capital of the island, and also advanced extensive urban planning in Taipei. The Republic of China took over the island in 1945 following Japanese surrender. After losing Mainland China to the Chinese Communist Party in the Chinese Civil War, the ruling Kuomintang (KMT) resettled the ROC government to Taiwan and declared Taipei the provisional capital of the Republic of China in December 1949.