 He graduated from the United States Military Academy at West Point, 45th in the Class of 1846.With the outbreak of the Mexican–American War, he was assigned to Company D, 7th U.S. Infantry as second lieutenant.In November 1846, he was transferred to Company E, 4th U.S. Infantry.