Born in Virginia, Hill was a career United States Army officer who had fought in the Mexican War and Seminole Wars prior to joining the Confederacy. After the start of the Civil War, he gained early fame as the commander of the "Light Division" in the Seven Days Battles and became one of Stonewall Jackson's ablest subordinates, distinguishing himself in the 1862 battles of Cedar Mountain, Second Bull Run, Antietam, and Fredericksburg.
Following Jackson's death in May 1863 at the Battle of Chancellorsville, Hill was promoted to lieutenant general and commanded the Third Corps of Robert E. Lee's Army of Northern Virginia, which he led in the Battle of Gettysburg and the fall campaigns of 1863. His command of the corps in 1864–65 was interrupted on multiple occasions by illness, from which he did not return until just before the end of the war, when he was killed during the Union Army's offensive at the Third Battle of Petersburg.
Hill is usually referred to as A. P. Hill, to differentiate him from another prominent (unrelated) Confederate general, Daniel Harvey Hill.