During the Mexican–American War, Baker briefly dropped out of politics and was commissioned as a Colonel of the Fourth Regiment of the Illinois Volunteer Infantry, on July 4, 1846.
Under den mexicansk-amerikanske krig opgav Baker i en kort periode politik og blev udpeget til oberst for 4th Regiment of the Illinois Volunteer Infantry, den 4. juli 1846.