Torbert's other brigade, under Brig. Gen. George A. Custer, dismounted and deployed in a long, double-ranked line of battle, as if they were infantrymen. Custer inspired his men by staying mounted as he led them forward. Receiving heavy rifle and artillery fire, 41 of the Union cavalrymen fell in the attack. Meanwhile, a mistaken identification of some dismounted Union cavalrymen as infantry concerned Hampton and he gave the order to begin withdrawing. (Hampton had also just received intelligence from prisoners on the location of two Union corps that had crossed the Pamunkey, which meant that his reconnaissance mission had been successfully completed.) As the Confederate brigades withdrew, Custer took advantage of the situation by charging forward for a final attack. Davies's brigade joined the attack and the remaining Confederate line fell apart into a rout, but by nightfall Hampton's cavalry was safely west of Totopotomoy Creek.