The Warlord Era was the period in the history of the Republic of China between 1916 and 1928, when control of the country was divided between rival military cliques of the Beiyang Army and other regional factions. It began after the death of Yuan Shikai, the President of China after the Xinhai Revolution had overthrown the Qing dynasty and established the Republic of China in 1912. Yuan's death on 6 June 1916 created a power vacuum which was filled by military strongmen and widespread violence, chaos, and oppression. The Nationalist Kuomintang (KMT) government of Sun Yat-sen, based in Guangzhou, began to contest Yuan's Beiyang government based in Beijing for recognition as the legitimate government of China.
The most powerful cliques were the Zhili clique led by Feng Guozhang, who controlled several northern provinces; the Anhui clique led by Duan Qirui, based in several southeastern provinces; and the Fengtian clique led by Zhang Zuolin, based in Manchuria. The three cliques often engaged in conflict for territory and hegemony. In mid-1917, after Yuan's successor Li Yuanhong attempted to remove Duan as premier, the general Zhang Xun forced Li to resign and made a brief attempt to restore the Qing dynasty, which was quashed by Duan's troops. Feng became the acting president, but was forced to step down by Duan in late 1918 and was replaced by Xu Shichang. In mid-1920, the new Zhili clique leaders, Cao Kun and Wu Peifu, defeated Duan in the Zhili–Anhui War in an alliance with Zhang Zuolin. A power struggle broke out between Cao and Zhang which ended with Cao's victory in the First Zhili–Fengtian War in 1922. Cao was president until 1924, when during the Second Zhili–Fengtian War he was betrayed by his subordinate Feng Yuxiang, who joined with Zhang to stage a coup against Cao. Feng and Zhang shared power and recalled Duan to serve as president before Zhang removed them both in 1926; in 1927, he declared himself Generalissimo.