Early in the Civil War, Cobham began recruiting in Warren County following the Union disaster at the First Battle of Bull Run. Invited to join the regiment then forming at Erie, Pennsylvania, Cobham led his men into camp and on January 28, 1862, he became lieutenant colonel of the 111th Pennsylvania Volunteer Infantry. The regiment served on garrison duty at Baltimore, Maryland, and Harpers Ferry. It also served under Maj. Gen. Nathaniel P. Banks at the Battle of Cedar Mountain, in the division of Brig. Gen. Christopher C. Augur. Cobham fell ill with typhoid fever in July 1862 and did not rejoin the regiment until October of that year. He was promoted to the rank of colonel on November 7, 1862. Cobham led the regiment at the Battle of Chancellorsville in Brig. Gen. John W. Geary's second division of XII Corps. Cobham was credited with capturing the flag of the 5th Alabama Infantry during the fight. When brigade commander, Brig. Gen. Thomas L. Kane, was taken ill, Cobham led the 2nd Brigade of Geary's division in the Gettysburg Campaign. Kane returned to the brigade during the Battle of Gettysburg on July 2, 1863, but he was unable to retain command. Cobham resumed command. The brigade built defenses on Culp's Hill. As evening fell, they were ordered to march to the relief of the left flank of the army. Starting without a guide, Geary got lost and took Cobham's and Charles Candy's brigade down the Baltimore Pike in the wrong direction. Returning with the brigade to the Culp's Hill area in the early morning hours of July 3, Cobham took part in the fighting of July 3, helping to hold off the confederate attacks. When XII Corps was transferred under the command of Maj. Gen. Joseph Hooker to relieve the Army of the Cumberland, besieged at Chattanooga, Cobham was transferred with his brigade. They fought at the Battle of Wauhatchie, the Battle of Lookout Mountain and the Battle of Ringgold Gap. When the XII Corps and XI Corps were amalgamated into the XX Corps under Hooker, Cobham reverted to command of the 111th Pennsylvania Infantry, still part of Geary's second division. Cobham participated in Maj. Gen. William T. Sherman's Atlanta Campaign. He took command of 3rd Brigade, 2nd Division, XX Corps, when its commander, Col. David Ireland, was wounded at the Battle of Resaca on May 15, 1864. He led the brigade until Ireland returned on June 6. Col. Cobham was killed while leading his regiment at the Battle of Peachtree Creek on July 20. Cobham was awarded a posthumous brevet promotion to the rank of brigadier general on July 19, 1864, predated to before his death. Geary, his division commander, described Cobham in one of his letters as a valuable and beloved officer.
Burial and legacy
Cobham was buried at Oakland Cemetery in Warren, Pennsylvania. In a family tiff in 1865, his remains were exhumed and reburied in the family burial plot at Cobham Park, the family home in Warren County, Pennsylvania. As a result, Cobham's wife and in-laws sued the Cobham family for their return. The case was dismissed by the court, and General Cobham remained buried at Cobham Park. In 1896, the local post of the Grand Army of the Republic convinced the surviving family to allow Cobham's reburial in the GAR plot at Oakland Cemetery, where he rests today. Cobham's wartime letters to his mother and brother are part of the collections of the Warren County, Pennsylvania Historical Society. Some additional letters written by him are in the Salvation Army Archives in Alexandria, Virginia.