He served in the Spanish–American War and later in the Philippines. He led the US expedition against Mexico in 1916. In May 1917 he was appointed commander of the American Expeditionary Forces in France and his talent for organization was largely responsible for the moulding of hastily trained US soldiers into well-integrated combat troops. In 1919 he became general of the armies of the USA and from 1921 to 1924 was army chief-of-staff.