. McMahon was commissioned in the Fourth Artillery, Artillery Corps. From 1891 to 1895, he was an aide to General
Alexander McDowell McCook. During the
Spanish–American War, he was the adjutant general of Second Brigade, Provisional Division, from June to July 1898. He was in
Puerto Rico in 1898 and 1899, and served during the
Philippine–American War. He served in the Spanish-American War and was promoted again, this time to captain, in May 1898, and was also made an assistant adjutant general. That same year saw him graduate from the Artillery School. In July 1899 he became a major in the
31st Infantry and, following the end of the
Philippine–American War which he briefly participated in, McMahon was mustered out in June 1901, after having been made a captain of Artillery in January of that year. In January 1907 he was promoted to a major of Artillery before being assigned to the newly created
Field Artillery Branch. While serving on the
General Staff from 1911 to 1914 he was promoted to lieutenant colonel in May 1911, before being made a colonel several years later, in June 1916, by which time
World War I had been raging for almost two years. In late August 1917, almost five months after the
American entry into World War I, McMahon was promoted to the temporary rank of brigadier general and was assigned to command the 160th Field Artillery Brigade, part of the
85th Division. His assignment there was only brief before he took over the 167th Field Artillery Brigade, part of the
92nd Division, at
Camp Dix,
New Jersey. He was in command of the brigade until December when he took command of the newly activated
5th Division, then being formed and organized at
Camp Logan,
Texas. As a result of his new command he received another promotion, this time to the temporary rank of major general, in February 1918. Under his direction, the division, created from
Regular Army units stationed around the United States, began to depart for service overseas with the
American Expeditionary Forces (AEF) in France, with the first units stepping foot in France in March. In order to ready itself for combat against the
Imperial German Army, the division began training in the
Anould and
Saint-Dié sectors, near the
Vosges mountains. When this was concluded it then took part in the
Battle of Saint-Mihiel in mid-September 1918. With the battle over, the division rested for a while before being called upon to take part in the
Meuse–Argonne offensive, where McMahon was relieved of his command of the 5th Division in mid-October, with the division by now badly disorganised and suffering from low morale, the blame for which was placed on McMahon. Major General
Hanson Edward Ely took his place. He was then very briefly assigned to command the
41st Division before returning home to the United States. He retired as a colonel due to disabilities in October 1919 and he died in late January the following year. His rank of major general was restored posthumously in 1930. ==Personal life==