The Battle of Williamsburg, also known as the Battle of Fort Magruder, took place as part of the Peninsula Campaign. In the first pitched battle of the campaign, nearly 41,000 Federals and 32,000 Confederates were engaged. Following up the Confederate retreat from Yorktown, Maj. Gen. Joseph Hooker’s division encountered the Confederate rearguard near Williamsburg.
When Gen. Joseph E. Johnston withdrew from the Warwick–Yorktown Line, he established a rear guard position along a series of redoubts built by Maj. Gen. John Bankhead Magruder. The key position was Fort Magruder, which commanded the junction of 2 roads leading up the Peninsula to Williamsburg. Maj. Gen. James Longstreet’s division took up positions in Fort Magruder and the nearby redoubts during the evening of May 4 under pressure from Union cavalry. Hooker's division encountered the Confederate rearguard near Williamsburg.
On May 5, Hooker conducted a morning assault against Fort Magruder, an earthen fortification alongside the Williamsburg Road, but was repulsed. The Union line was driven back by a strong Confederate counterattacks, directed by Longstreet. Brig. Gen. Philip Kearny’s division arrived to stabilize the Union position. The Confederates counterattack was unsuccessful and the Confederates fell back into their defenses. Meanwhile, Brig. Gen. Winfield Scott Hancock’s brigade had marched behind the Confederate left flank and occupied 2 vacant redoubts along Cub Creek. Hancock’s men then began shelling the Confederate flank and rear.Longstreet sent elements of Maj. Gen. D. H. Hill’s division to dislodge the Federals. Hill and Brig. Gen. Jubal A. Early hastily prepared a flank attack, but the assault was misdirected and disjointed, resulting in a bloody repulse.
That night, successful in delaying the Union advance, the Confederates abandoned their redoubts and continued their withdrawal toward Richmond. Maj. Gen. George McClellan telegraphed to Washington, "The victory is complete." The Northern press portrayed the battle as a victory for the Federal army. McClellan mis-categorized it as a "brilliant victory" over superior forces. However, the defense of Williamsburg was seen by the South as a means of delaying the Federals, which allowed the bulk of the Confederate army to continue its withdrawal toward Richmond. Confederate casualties, including the cavalry skirmishing on May 4, were 1,682. Union casualties were 2,283.
The Battle of Williamsburg was the first pitched battle of the Peninsula Campaign.