He then received promotions to first lieutenant as of February 18, and to captain as of September 5, both in the 11th U.S. Infantry, serving as a recruiting officer.
He was elected colonel of the regiment on June 20, 1861, and resigned the following day to accept a commission in the regular army as a captain in the 6th U.S. Cavalry.
[2] He led the Third Brigade at the battles of Chancellorsville and Gettysburg in a division commanded by his cousin David Gregg.
He was wounded at the Second Battle of Deep Bottom and won a brevet again on October 7, 1864, to full colonel in the regular army.
On December 12, 1864, President Abraham Lincoln nominated Gregg for appointment to the grade of brevet brigadier general of volunteers to rank from August 1, 1864, for gallant and meritorious service in the engagement and defenses of Richmond on the Brock Turnpike and at the Battle of Trevilian Station and the United States Senate confirmed the appointment on February 20, 1865.
He was named colonel of the 8th U.S. Cavalry on July 28, 1866,[2] a position his cousin David McMurtrie Gregg had desired.
He was sent to the New Mexico Territory, where he commanded Fort Union from 1870 to 1873, and led efforts in that region to pursue and subdue the Apache.