 McIlhenny participated in the Battle of Las Guasimas and the Battle of San Juan Hill and continued to serve despite suffering from measles and malaria.On his return to civilian life, McIlhenny served in the Louisiana State Legislature, winning a seat in the Louisiana House of Representatives from 1900 to 1904 and in the state Senate from 1904 to 1906 as a Democrat.A close companion of Theodore Roosevelt, in 1906 he accepted then President Roosevelt's offer to help oversee the United States Civil Service Commission, during which he enacted numerous reforms which streamlined the federal bureaucracy.