After failing to capture Petersburg by assault, Grant's first objective was secure the three remaining open rail lines that served Petersburg and Richmond: the Richmond and Petersburg Railroad; the South Side Railroad, which reached to Lynchburg in the west; and the Weldon Railroad, also called the Petersburg and Weldon Railroad, which led to Weldon, North Carolina, and the Confederacy's only remaining major port, Wilmington, North Carolina. Grant decided on a wide-ranging cavalry raid (the Wilson-Kautz Raid) against the South Side and Weldon railroads, but he also directed that a significant infantry force be sent against the Weldon closer to his current position. Meade selected the II Corps, still temporarily commanded by Birney, and Wright's VI Corps.
Grant wanted to defeat Lee's army without resorting to a lengthy siegehis experience in the Siege of Vicksburg told him that such affairs were expensive and difficult on the morale of his men. Lt. Col. Henry Pleasants, commanding the 48th Pennsylvania Infantry of Maj. Gen. Ambrose E. Burnside's IX Corps, offered a novel proposal to solve Grant's problem. Pleasants, a mining engineer from Pennsylvania in civilian life, proposed digging a long mine shaft underneath the Confederate lines and planting explosive charges directly underneath a fort (Elliott's Salient) in the middle of the Confederate First Corps line. If successful, Union troops could drive through the resulting gap in the line into the Confederate rear area. Digging began in late June, creating a mine in a "T" shape with an approach shaft 511 feet (156 m) long. At its end, a perpendicular gallery of 75 feet (23 m) extended in both directions. The gallery was filled with 8,000 pounds of gunpowder, buried 20 feet (6.1 m) underneath the Confederate works.
Burnside had trained a division of United States Colored Troops (USCT) under Brig. Gen. Edward Ferrero to lead the assault. Two regiments were to leave the attack column and extend the breach by rushing perpendicular to the crater, while the remaining regiments were to rush through, seizing the Jerusalem Plank Road. Burnside's two other divisions, made up of white troops, would then move in, supporting Ferrero's flanks and race for Petersburg itself. However, the day before the attack, Meade, who lacked confidence in the operation, ordered Burnside not to use the black troops in the lead assault, claiming that if the attack failed black soldiers would be killed needlessly, creating political repercussions in the North. Burnside protested to General Grant, who sided with Meade. When volunteers were not forthcoming Burnside selected a replacement white division by having the three commanders draw lots. Brig. Gen. James H. Ledlie's 1st Division was selected, but he failed to brief the men on what was expected of them and was reported during the battle to be drunk, well behind the lines, and providing no leadership. (Ledlie was later dismissed for his actions during the battle.)
At 4:44 a.m. on July 30, the charges exploded in a massive shower of earth, men, and guns. A crater (still visible today) was created, 170 feet (52 m) long, 60 to 80 feet (24 m) wide, and 30 feet (9.1 m) deep. The blast destroyed the Confederate fortifications in the immediate vicinity, and instantly killed between 250 and 350 Confederate soldiers. Ledlie's untrained white division was not prepared for the explosion, and reports indicate they waited ten minutes before leaving their own entrenchments. Once they had wandered to the crater, instead of moving around it as the black troops had been trained to do, they moved down into the crater itself. Since this was not the planned movement, there were no ladders provided for the men to use in exiting the crater. The Confederates, under Maj. Gen. William Mahone, gathered as many troops together as they could for a counterattack. In about an hour's time, they had formed up around the crater and began firing rifles and artillery down into it, in what Mahone later described as a "turkey shoot". The plan had failed, but Burnside, instead of cutting his losses, sent in Ferrero's men. Now faced with considerable flanking fire, they also went down into the crater, and for the next few hours, Mahone's soldiers, along with those of Maj. Gen. Bushrod Johnson and artillery, slaughtered the men of the IX Corps as they attempted to escape from the crater. Some Union troops eventually advanced and flanked to the right beyond the Crater to the earthworks and assaulted the Confederate lines, driving the Confederates back for several hours in hand-to-hand combat. Mahone's Confederates conducted a sweep out of a sunken gully area about 200 yards (180 m) from the right side of the Union advance. This charge reclaimed the earthworks and drove the Union force back towards the east.
Grant wrote that, "It was the saddest affair I have witnessed in the war." Union casualties were 3,798 (504 killed, 1,881 wounded, 1,413 missing or captured), Confederate casualties were approximately 1,500 (200 killed, 900 wounded, 400 missing or captured). Many of these losses were suffered by Ferrero's division of the USCT. Burnside was relieved of command.