"Inactivity continued for some time, Longstreet commanding the center with his own and other troops, until it was soon apparent to Johnston that Richmond was too much exposed to attacks on the north side of the James River. The capital must be covered; besides, both our flanks were endangered by the enemy's immense superiority on the water. Preparations therefore began for a move, and on the night of May 3 the army was successfully drawn from its trenches and started on its deliberate, well-ordered retreat. On May 5 our rearguard was overtaken and attacked in force at Williamsburg, Longstreet in command, with a considerable part of the army. It was a stubborn, all-day fight, with serious losses on both sides, but the enemy was beaten off and we resumed the march that night, the Federals having enough of it. . . .
". . . .General Johnston was present on the field all day, but seeing Longstreet, the rearguard commander, carrying things very handsomely, generously forbore any interference and left the battle to his handling. He sent the latter such additional troops as he had to call for from time to time. When night came it was horrible. There were many dead and wounded and the weather nasty; the roads ankle deep in mud and slush. But the march had to be again taken up."
Source: Recollections of a Confederate Staff Officer
Commentary
Moxley Sorrel's commentary on the battle of Williamsburg: