 After a month of preparation , just before he was to assault the Confederate works at Yorktown , McClellan learned that Johnston had withdrawn up the Peninsula towards Williamsburg . McClellan was thus required to give chase without any benefit of the heavy artillery so carefully amassed in front of Yorktown . The Battle of Williamsburg on May 5 is considered a Union victory — McClellan 's first — but the Confederate army was not destroyed and a bulk of their troops were successfully moved past Williamsburg to Richmond 's outer defenses while the battle was waged and for several days thereafter . 
