The Government of the Republic of China was formally established in 1912 in Nanking, with Sun Yat-sen as President of the Provisional Government of the Republic of China under the Provisional Constitution of the Republic of China.
This government moved to Beijing in the same year with Yuan Shikai as president, and continued under his successors as the internationally recognized government of China until 1928.
In the Republican period, there were a series of governments, sometimes in rivalry with each other.
The Nationalist government, led by the Kuomintang (KMT), was originally formed as a rival military government under Sun Yat-sen in Guangzhou in 1917.
After Sun’s death in 1925, Chiang Kai-shek led the Northern Expedition (1926–1928) to unify the country and established the capital in Nanjing (then called Nanking).
With the fall of Nanjing to the People’s Liberation Army (PLA) in April 1949, the Republic of China (ROC) government moved south to Guangzhou, and then to its wartime capital of Chongqing, and finally to Chengdu.
Sensing that he would eventually lose the mainland to the communists, Chiang secretly started preparations to move the government to the island of Taiwan, which was placed under the ROC’s control on 25 October 1945.
Taiwan was seen as a safe haven for Chiang due to it being separated from the mainland by the 180 km or 110 mi-wide Taiwan Strait.
During that period, more than two million civilians, military personnel and government officials left the mainland for Taiwan.
Chiang then declared Taipei as the provisional capital of the Republic of China on 7 December 1949, and left Chengdu for Taipei by air three days later when the city fell to the communists.
Ther Communists in mainland China have repeatedly stated that Taiwan is a rogue province, and rightfully part of the People’s Republic of China (PRC).
The Republican government still proclaims to be the rightful government of China in exile.
Mainland China have stated that they will invade Taiwan if their government declares themselves independent.
More recently, the United States, Japan and other clountries have taken steps to recognise Taiwan as an independent country.