From 1847 to 1849 he represented his district in Congress, to which he declined reelection. He was a delegate to the State reform convention in 1850, and was elected to the State senate in 1857.
Upon the secession of Virginia he enlisted in the cavalry service, and being promoted to captain and then major, was put in command at Camp Lee, near Hague, on the lower Potomac, where his intelligence and excellent judgment were of much value. Subsequently he served under Col. W. H. F. Lee, in the Ninth cavalry regiment until Lee was promoted brigadier general, when he was advanced to the rank of colonel and given command of the regiment.
In December,1862, he attracted attention and much favorable comment by a bold expedition into Rappahannock county, in which the Federal garrison at Leeds was captured, without loss.
On April 16, 1863, he won the praise of J. E. B. Stuart for his heroic service in meeting and repelling the threatened raid of Stoneman's cavalry division, and during the renewed movement by Stoneman at the close of the month, he was for a week in almost constant fighting, his regiment everywhere behaving valorously and capturing many prisoners.
At the battle of Fleetwood he led the Ninth in the brilliant charge in which Gen. W. H. F. Lee was wounded and Colonel Williams killed. He participated in Stuart's raid through Maryland, fought at Gettysburg, and rendered faithful service in the cavalry affairs during the return to Virginia.
During the fight at Culpeper Court House he was in command of W. H. F. Lee's brigade.
In March, 1864, having been stationed on the Northern Neck, he made a forced march to intercept Dahlgren and his raiders, and a detachment of his regiment under First Lieutenant James Pollard, Company H, successfully ambushed the Federals, and aided by other detachments captured about 175 men and killed Dahlgren. The papers found upon Dahlgren's person, revealing a design to burn Richmond and kill President Davis and cabinet, were forwarded through Fitz Lee, to the government. A correspondence with the Federal authorities followed, in which they disavowed all knowledge of such a design.
He participated in command of his regiment in the campaign from the Rapidan to the James, was distinguished in the fighting at Stony Creek, and toward Reams' Station, in July, capturing two Federal standards; and in August, upon the death of General Chambliss, was given command of the brigade.
February 6, 1865, he was promoted brigadier general, and in this rank he served during the remainder of the struggle.