The fomenters of the Xinhai Revolution of 1911 sought to replace Qing rule with a republic and leaders like Sun Yat-sen originally intended to return the capital to Nanjing. After the Qing general Yuan Shikai forced the abdication of the last Qing emperor and ensured the success of the revolution, the revolutionaries accepted him as president of the new Republic of China. Yuan maintained his capital at Beijing and quickly consolidated power, declaring himself emperor in 1915. His death less than a year later[62] left China under the control of the warlords commanding the regional armies. Following the success of the Kuomintang's Northern Expedition, the capital was formally moved to Nanjing in 1928. On 28 June the same year, Beijing's name was returned to Beiping (written at the time as "Peiping").[17][63]
On 7 July 1937, the 29th Army and the Japanese army in China exchanged fire at the Marco Polo Bridge near the Wanping Fortress southwest of the city. The Marco Polo Bridge Incident triggered the Second Sino-Japanese War, World War II as it is known in China. During the war,[17] Beijing fell to Japan on 29 July 1937[64] and was made the seat of the Provisional Government of the Republic of China, a puppet state that ruled the ethnic-Chinese portions of Japanese-occupied northern China.[65] This government was later merged into the larger Wang Jingwei government based in Nanjing.[66]