Ma was too young to participate in the First Sino-Japanese War, in which he wanted to fight. He then joined the Kansu Braves, serving under Ma Haiyan, fought against the foreigners in the Boxer Rebellion at the Battle of Peking (1900) and helped guard the Imperial Court when it evacuated to Xi'an.