The Republic of China was formally established on 1 January 1912 on mainland China following the Xinhai Revolution which itself began with the Wuchang Uprising on 10 October 1911, and replaced the Qing Dynasty and ended over two thousand years of imperial rule in China.
Though the presidency of the new republic was supposed to be handed to General Yuan Shikai, Sun Yat-sen was able to convince Yuan to accept the position of provisional Commander-in-chief with the promise that he is able to form his own separate monarch in Manchuria when the China is stabilized. Giving Yuan the position demoted Huang Xing to the provisional Minister of Foreign Affairs; this greatly strained the relation between Sun and Huang.
The early years of the republic was faced with wide scale economic disaster, the agricultural reform that the peasants desperately needed was not implemented in many areas, and badly maintained in area that did receive it. Along with poor development and reformation in the domestic areas, China also faced warlordism in unregulated provinces.
The industrial and civil sector, as well as its military, experienced rapid development, contrast to the agricultural sector, mainly due to the Sino-German cooperation in 1912, which allowed the drafting of a Chinese civil code (based upon the German civil code) and military development, and also granted six million Goldmark loan to the Chinese Republic.
Because of the 1902 Anglo-Japanese and the Triple Entente of 1907, Germany proposed a German-Chinese-American Entente in 1907, and the Entente was created in the summer of 1914, with the signing of the Alliance between the three countries in the Nanjing Presidential Place.
The tension between Sun Yat-sen and Huang Xing reached climax after the signing of the alliance, for Huang Xing strongly opposed to increasing the influence of the west in China, and staged anti-imperialism protests in Nanjing and Shanghai. The protests were violently dispersed and resulted Huang Xing's exile to Hokkaido.
The July 3rd protests resulted Sun Yat-sen's growing distrust of his fellow revolutionaries, especially Yuan Shikai. In February 5th, 1915, Yuan Shikai was convicted of treason for secretly supporting Russia's presence in northern China, and a kangaroo trial was held in Nanjing Provisional court, ultimately with Yuan Shikai sentenced to death.
With Yuan Shikai's death, Li Yuanhong was able succeed him as the second commander-in-chief of the Chinese Republic. Despite Li Yuanhong's popularity with the military, he had no obvious intent of surpassing Sun Yat-sen in power.
In March, 23rd, 1917, Sun Yat-sen launched a large scale campaign to end the warlordism in China by military means, and was successfully able to purge the warlords in southern China, but leaving the north relatively untouched. The generals were impressed with the speed and effectiveness of the reformed Chinese military, and placed faith in Sun Yat-sen for finally securing China after years of endless turmoil caused by internal struggles and foreign influences.