Taipei, officially Taipei City, and previously known as Taihoku from 1895 to 1945 is the capital and a special municipality of the Republic of China, commonly known as Taiwan. Located in Northern Taiwan, Taipei City is an enclave of the municipality of New Taipei City that sits about southwest of the northern port city of Keelung. Most of the city rests on the Taipei Basin, an ancient lakebed. The basin is bounded by the relatively narrow valleys of the Keelung and Xindian rivers, which join to form the Tamsui River along the city's western border.