Mechanicsville, and the surrounding area, was the site of numerous battles during the American Civil War. The first was the Battle of Beaver Dam Creek, which began on June 26, 1862. Confederate General A.P. Hill launched a series of assaults against Union Major General Fitz John Porter's army positioned along Beaver Dam Creek, just east of Mechanicsville. Union forces repulsed the Confederate attacks and afterward withdrew to a new position along Boatswain Creek near Gaines' Mill. The Beaver Dam Creek engagement was the second in the series of Civil War battles known as the Seven Days Battles. A small portion of the battlefield in the southeast part of the CDP has been preserved as part of the Richmond National Battlefield Park, a park area administered by the National Park Service.