Grant's nine-month siege of Petersburg from June 1864 to April 1865 anticipated the trench warfare of World War I, with both armies entrenched in elaborate earthwork systems stretching 37 miles around the city that protected Richmond's supply lines. The Battle of the Crater — in which Union soldiers tunneled beneath Confederate lines and detonated four tons of gunpowder — was one of the most dramatic and disastrous episodes of the entire war.