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.