"It was the saddest affair I have witnessed in the war." (Ulysses S. Grant)
After the last major pitched battle of the Overland Campaign was fought at Cold Harbor in early June, Ulysses S. Grant and the Army of the Potomac nearly captured Richmond in mid-June by stealing a march on Robert E. Lee’s Army of Northern Virginia. The fog of war, poor luck, and a skillful impromptu defense by P. G. T. Beauregard stopped Grant from taking Petersburg, which was a critical railroad hub and supply line for Richmond, before Lee's army could confront, thereby saving the Confederacy for the time being.
The two armies began to dig in around Petersburg, but at the end of June, Pennsylvania coal miners in the Army of the Potomac came up with an idea. They offered to dig a mine over 500 feet long underneath the lines between the Union and Confederate armies and fill it with gunpowder, which would detonate just 20 feet below where the Confederate soldiers were positioned. Through skillful work, the mine was packed with 8,000 pounds of gunpowder and set to detonate on the morning of July 30. The ensuing explosion would rip a giant hole in the Confederate line, allowing a Union attack to rush through the breached Confederate line and into Petersburg itself. Ulysses S. Grant later said, "Such an opportunity for carrying fortifications I have never seen and do not expect again to have."