At the beginning of the American Civil War in 1861, Cockrell joined the Missouri State Guard as a Captain. After being mustered into the Confederate States Army in the 2nd Missouri Regiment in early 1862 (which was formed as the 1st, but renumbered as Bowen had already formed a regiment); being promoted to colonel. Cockrell commanded a brigade in the Vicksburg Campaign. He distinguished himself at the Battle of Champion Hill, launching a counterattack that temporarily ousted troops of XVII Corps off the hill. He also took part in the Battle of Big Black River Bridge. His brigade was able to escape just before federal troops seized the bridge. He was wounded in the hand by an exploding shell during the Siege of Vicksburg.