At the initial outbreak of the Civil War, Keyes was promoted to
colonel of the 11th U.S. Infantry on
May 14 1861, and three days later was promoted to the rank of
brigadier general of the U.S. Volunteers. General Keyes then served briefly on the staff of
New York Governor Edwin D. Morgan until
June 251861, overseeing that state's raising of militia.
At the battle of
First Manassas, Keyes commanded the 1st Brigade, 1st Division (Tyler), and then led Keyes' Brigade, before assuming command of a division from
November 9 1861 –
March 13 1862. He was then given command of IV Corps, leading it from its inception on
March 3 1862, until its discontinuation on
August 1 1863. When Major General
George B. McClellan's big push against
Richmond was organized in the spring of 1862, Keyes led in unexceptionable fashion during the
Peninsula Campaign.
Keyes saw action at Lee's Mill, Yorktown, Bottom's Bridge, Savage's Station, Fair Oaks, Charles City Cross Roads, Malvern Hill, and Harrison's Landing. For gallantry at the
Battle of Fair Oaks, Keyes received the
brevet of
brigadier general in the
Regular Army. After the Army of the Potomac left the Pensinsula, the IV Corps remainded behind as a part of General
John Adams Dix's Department of Virginia. General Keyes was promoted to Major General of U.S. Volunteers on
May 5 1862. In addition to the IV Corps, he commanded the Yorktown District,
VII Corps, and the division at
Suffolk. Among Keyes' other actions were the raid to White House, Virginia on
January 7 1863, and the expedition to West Point, Virginia, on
May 7 1863.
During the
Gettysburg Campaign in 1863, Keyes fell afoul of General Dix's strategic plan to demonstrate heavily against Richmond in order to divert Confederate reenforcements from General
Robert E. Lee's army in
Pennsylvania. Keyes retreated from a position near what is now Tallysville,
Virginia in the face of what Dix deemed to be inferior forces, so Dix had Keyes removed from command.
Although Keyes asked for an investigation of the charges that led to his removal, the request was never granted. Keyes then served on various boards and commissions, including the board for retiring disabled officers from
July 15 1863, until his resignation and retirement from the army on
May 6 1864.