[9] In 1861, Gobin enlisted for the American Civil War and was commissioned a first lieutenant in Company F of the 11th Pennsylvania Infantry.
After the unit's three-month term of service expired Gobin organized Company C of the 47th Pennsylvania Infantry, which he commanded as a captain.
[10] The 47th Pennsylvania served throughout the rest of the war, primarily in Florida, South Carolina and Virginia, and Gobin rose through the ranks to become the regiment's colonel and commander.
After the surrender of the Confederacy, Gobin served as a Provost Marshal in South Carolina and Georgia until he was mustered out of the service on January 9, 1866.
He was also active in the Grand Army of the Republic and the Military Order of the Loyal Legion of the United States.
He led his brigade during mobilization and training near Augusta, Georgia, but resigned in order to run for lieutenant governor, and returned to National Guard service in Pennsylvania.
[22][23] In 1906 he was promoted to major general as commander of the Pennsylvania National Guard Division, succeeding Charles Miller.