In March 1861, just before the outbreak of the US Civil War, he resigned his commission, and when Virginia seceded he was made colonel of a Virginian infantry regiment, winning promotion to the rank of brigadier-general on the field of Bull Run.
In the Peninsular campaign of 1862 he gained further promotion, and as a major-general Hill was one of the most prominent and successful divisional commanders of Robert E. Lee's army in the Seven Days', Second Bull Run, Antietam, and Fredericksburg campaigns. His division formed part of Stonewall Jackson's corps, and he was severely wounded in the flank attack of Chancellorsville in May 1863. After Jackson's death, Hill was made a lieutenant-general and placed in command of the 3rd corps of Lee's army, which he led in the Gettysburg campaign of 1863, the autumn campaign of the same year, and the Wilderness and Petersburg operations of 1864 - 1865. He once said he had no desire to live to see the collapse of the Confederacy, and was killed by a Union soldier as he rode to the front of the Petersburg lines on April 2, 1865.
Hill was one of the war's most highly regarded generals on both sides, and on their death beds, both Lee and Jackson called for A. P. Hill to bring up his troops.