[1] When Confederate General Joseph E. Johnston unexpectedly withdrew his forces from the Warwick Line at the Siege of Yorktown the night of May 3, Union Maj. Gen. George B. McClellan was taken by surprise and was unprepared to mount an immediate pursuit.
Gen. William B. Franklin's division to board transport ships on the York River in an attempt to move upstream and land so as to cut off Johnston's retreat.
[3] By May 5, Johnston's army was making slow progress on muddy roads and Stoneman's cavalry was skirmishing with Brig.
To give time for the bulk of his army to get free, Johnston detached part of his force to make a stand at a large earthen fortification, Fort Magruder, straddling the Williamsburg Road (from Yorktown), constructed earlier by Brig.
Confederate counterattacks, directed by Maj. Gen. James Longstreet, threatened to overwhelm Hooker's division, which had contested the ground alone since the early morning while waiting for the main body of the army to arrive.
Gen. William F. "Baldy" Smith's 2nd Division of the IV Corps, marching north on the Yorktown Road, to hear the sound of battle and come in on Hooker's right in support.
Regimental bands playing Yankee Doodle slowed the retreating troops as they passed by, allowing them to rally long enough to be aided by the arrival of Brig.
Gen. Winfield S. Hancock's 1st Brigade of Baldy Smith's division, which had marched a few miles to the Federal right and crossed Cub's Creek at the point where it was dammed to form the Jones' Mill pond, began bombarding Longstreet's left flank around noon.
Splitting his command, Early led two of his four regiments (the 24th and 38th Virginia Infantry) through the woods without performing adequate reconnaissance and found that they emerged not on the enemy's flank, but directly in front of Hancock's guns, which occupied two abandoned redoubts.
He personally led the 24th Virginia Infantry on a futile assault and was wounded by a bullet through the shoulder, putting him out of action for almost two months.
[7] Hancock had been ordered repeatedly by Sumner to withdraw his command back to Cub Creek, but he used the Confederate attack as an excuse to hold his ground.
Gen. Darius N. Couch's 1st Division of the IV Corps arrived to support and extend the right of Hooker's line, which had, by this stage, been pushed back from the cleared ground in front of Fort Magruder into the abatis and heavy wood about 600 – 1,000 yards (910 m) from the Confederate fortifications.
Peck's arrival on the field and his brigade's recovery of Bramhall's battery came at a critical moment for Hooker's division, which was on the verge of retreat.
Three Union regimental commanders were wounded in the battle and Col. William Dwight of the 70th New York Infantry was left behind on the field and captured by the Confederates.
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.