The Republic of China was a state in East Asia from 1912 to 1949. It largely occupied the present-day territories of China, Taiwan, and, for some of its history, Mongolia. As an era of Chinese history, it was preceded by the last imperial dynasty of China, the Qing dynasty, and ended with the Chinese Civil War. After the war, the losing Kuomintang retreated to the island of Taiwan to found the modern Republic of China, while the victorious Communist Party of China established the People's Republic of China on the Mainland.
The Republic's first president, Sun Yat-sen, served only briefly. His party, then led by Song Jiaoren, won a parliamentary election held in December 1912. However the army led by President Yuan Shikai retained control of the national government in Beijing. From late 1915 to early 1916 Yuan tried to reinstate a monarchy called Empire of China, with himself as the "Hongxian Emperor (洪憲皇帝)". It was a short-lived attempt. After Yuan's death in 1916, local military leaders, or warlords, asserted autonomy.
In 1925, the Kuomintang started establishing a rival government in the southern city of Guangzhou. The economy of the north, overtaxed to support warlord adventurism, collapsed in 1927–28. General Chiang Kai-shek, who became KMT leader after Sun's death, started his military Northern Expedition campaign in order to overthrow the central government in Beijing. The government was overthrown in 1928 and Chiang established a new nationalist government in Nanjing. He later cut his ties with the communists and expelled them from the KMT.
There was industrialization and modernization, but also conflict between the Nationalist government in Nanjing, the Communist Party of China, remnant warlords, and the Empire of Japan. Nation-building took a backseat to war with Imperial Japan when the Imperial Japanese military launched a full-scale invasion of China in 1937. The Nationalists' Y Force drove back the Japanese in Yunnan during a May–June 1944 offensive, but otherwise military results were disappointing. With the Japanese unconditional surrender in 1945, the Allies had finally achieved total victory, but the Cold War between the United States and Soviet Union led to renewed fighting between the KMT and the communists. In 1947, the Constitution of the Republic of China replaced the Organic Law of 1928 as the country's fundamental law. In 1949, the Communists established the People's Republic of China, overthrowing the Nationalists on the mainland, many of whom retreated to Taiwan.
A republic was formally established on 1 January 1912 following the Xinhai Revolution, which itself began with the Wuchang Uprising on 10 October 1911, overthrowing the Qing Dynasty and ending over two thousand years of imperial rule in China. From its founding until 1949 it was based on mainland China. Central authority waxed and waned in response to warlordism (1915–28), Japanese invasion (1937–45), and the Chinese Civil War (1927–49), with central authority strongest during the Nanjing Decade (1927–37), when most of China came under the control of the Kuomintang (KMT) under an authoritarian one-party state. At the end of World War II in 1945, the Empire of Japan surrendered control of Taiwan and its island groups to the Allied Forces, and Taiwan was placed under the Republic of China's administrative control. The legitimacy of this transfer is disputed and is another aspect of the disputed political status of Taiwan.
The communist takeover of mainland China in the Chinese Civil War in 1949 and later Hainan, Dachen and other outlying islands in the early 1950s left the ruling Kuomintang (KMT) with control over only Taiwan, Penghu, Kinmen, Matsu, and other minor islands. With the 1949 loss of mainland China in the civil war, the ROC government retreated to Taiwan and the KMT declared Taipei the provisional capital. The Communist Party of China took over all of mainland China and founded the People's Republic of China (PRC) in Beijing, which claimed to be the successor of the Republic of China and the sole legitimate government of all of "China" – a claim also nominally made by the Republic of China government which still rules from Taipei, although it no longer actively challenges the PRC's rule of mainland China. The ROC on Taiwan is currently officially recognized by 22 countries and enjoys informal relations with many more.
In 1912, after over two thousand years of imperial rule, a republic was established to replace the monarchy. The Qing Dynasty, having just experienced a century of instability, suffered from both internal rebellion and foreign imperialism. The Boxer Rebellion erupted in 1900, whose attacks on foreigners led to the invasion by the Eight Nation Alliance. China signed the Boxer Protocol and paid a large indemnity to the foreign powers: 450 million taels of fine silver (around $333 million or £67 million at the then curren