Cobb was a strong Unionist and opponent of secession, and when Alabama did secede in 1861, he withdrew from Congress only reluctantly. He ran unsuccessfully for the Confederate House of Representatives in 1861, but was elected to the Second Confederate Congress in 1863 amid growing antiwar sentiment. He however did not arrive to take his seat, and was subsequently expelled by a unanimous vote for his avowed Unionist sentiments. Cobb was killed by the accidental discharge of his own pistol while putting up a fence on his plantation near Bellefonte on November 1, 1864. He was buried in the family cemetery on the estate of his brother, Bryant Anderson Cobb, in neighboring Madison County.