Making a political alliance with the Empress Dowager, and becoming a lasting enemy of the Guangxu Emperor, Yuan left the capital in 1899 for his new appointment as Governor of Shandong. During his three-year tenure the Boxer Rebellion (1899–1901) erupted; Yuan ensured the suppression of Boxers in the province, though his troops took no active part outside Shandong itself. Yuan took the side of the pro-foreign faction in the Imperial Court, along with Prince Qing, Li Hongzhang, and Ronglu. He refused to side with the Boxers and attack the Eight-Nation Alliance forces, joining with other Chinese governors who commanded substantial modernized armies like Zhang Zhidong not participating in the Boxer Rebellion. He and Zhang ignored Empress Dowager Cixi's declaration of war against the foreign powers and continued to suppress the Boxers. This clique was known as The Mutual Protection of Southeast China. In addition to not fighting the Eight-Nation Alliance and suppressing the Boxers in Shandong, Yuan and his army (the Right Division) also helped the Eight-Nation Alliance suppress the Boxers after the Alliance captured Beijing in August 1900. Yuan Shikai's forces massacred tens of thousands of people in their anti-Boxer campaign in Zhili. Yuan operated out of Baoding during the campaign, which ended in 1902.