In August 1861 Peck received a promotion to brigadier general. He was assigned to the defenses of Washington. In 1862, he participated in the Peninsula campaign, during which he served at the battles of Williamsburg, Yorktown, Fair Oaks, Seven Days, Malvern Hill and Harrison'³ Landing. In July 1862 he was promoted to major general for his distinguished services in the campaign. In September 1862 he was assigned to the command of all the troops in Virginia south of the James. In the spring of 1863, he held command in the Siege of Suffolk. From August 1863 to April 1864, Peck held command in North Carolina. Due to ill health he returned home until he was called upon in July 1864, to command on the Canada frontier through the end of the war.