In June 1861, O'Neal was commissioned as a captain and commanded three companies of soldiers. Upon reaching Richmond he was appointed major of the 9th Regiment Alabama Infantry and was promoted to lieutenant colonel in the fall. In March 1862, he was appointed colonel of the 26th Alabama infantry, and commanded this regiment during the Peninsula Campaign. At the Battle of Seven Pines, his horse was killed under him, and he was severely wounded by a shell fragment. He received high praise for his performance at the Battle of Chancellorsville. In 1863, he commanded a brigade in Maj. Gen. Robert E. Rodes's division, and led it at the Battle of Gettysburg,  Battle of Manassas Gap and at the Battle of Mine Run. Early in 1864, his regiment was sent back to Alabama to recruit its depleted ranks but was quickly ordered to Dalton, Georgia, where O'Neal took command of Brig. Gen. James Cantey's brigade in the Army of Tennessee. O'Neal commanded this brigade during the remainder of the Atlanta Campaign. After Lt. Gen. John Bell Hood was given command of the Army of Tennessee, O'Neal was relieved and served on detached duty for the remainder of the war. He was appointed brigadier general on June 6, 1863, but this appointment was held up by Gen. Robert E. Lee and the promotion was canceled by Confederate President Jefferson Davis.