 In 1912, he participated in the formation of the Beiyang government of the Republic of China.In June 1914, he was sent to Shaanxi Province to suppress the Bai Lang Rebellion.From December 1915 to 1916, he fought in the National Protection War in defense of the Empire of China, but refused to support Zhang Xun's restoration of the Qing dynasty in July 1917.