Taiwan (i; Chinese: 臺灣 or 台灣; pinyin: Táiwān; see below), officially the Republic of China (ROC; Chinese: 中華民國; pinyin: Zhōnghuá Mínguó), is a sovereign state in East Asia. The Republic of China, originally based in mainland China, now governs only the island of Taiwan, which constitutes more than 99% of its territory,[e] as well as Penghu, Kinmen, Matsu, and other minor islands, following its loss of the mainland China territory in 1949 in the Chinese Civil War. This remaining area is also constitutionally called the "Free Area of the Republic of China" which is free from Communist rule.
Neighboring states include the People's Republic of China (PRC) to the west (mainland China), Japan to the east and northeast, and the Philippines to the south. Taiwan is one of the most densely populated countries in the world with a population density of 648 people per km2 in July 2015. Taipei is the seat of the central government, and together with the surrounding cities of New Taipei and Keelung forms the largest metropolitan area on the island.
The island of Taiwan (formerly known as "Formosa") was mainly inhabited by Taiwanese aborigines until the Dutch and Spanish settlement during the Age of Discovery in the 17th century, when Han Chinese began immigrating to the island. In 1662, the pro-Ming loyalist Koxinga expelled the Dutch and established the first Han Chinese polity on the island, the Kingdom of Tungning. The Qing dynasty of China later defeated the kingdom and annexed Taiwan. By the time Taiwan was ceded to Japan in 1895, the majority of Taiwan's inhabitants were Han Chinese either by ancestry or by assimilation. The Republic of China (ROC) was established in mainland China in 1912. After Japan's surrender in 1945, the ROC assumed its control of Taiwan. Following the Chinese civil war, the Communist Party of China took full control of mainland China and founded the People's Republic of China (PRC) in 1949. The ROC relocated its government to Taiwan, and its jurisdiction became limited to Taiwan and its surrounding islands, with the main island making up 99% of its de facto territory. Despite this, the ROC continued to represent China at the United Nations until 1971, when the PRC assumed China's seat via Resolution 2758 and the ROC lost its UN membership. International recognition of the ROC has gradually eroded as most countries switched recognition to the PRC. 21 UN member states and the Holy See currently maintain official diplomatic relations with the ROC. It has unofficial ties with most other states via its representative offices.