In March 1861, Ferguson was commissioned a captain in the South Carolina militia, afterwards being appointed Lieutenant and aide-de-camp to C.S. Army Brigadier-General P. G. T. Beauregard. He was one of the officers who received the formal surrender of U.S. Army Major Robert Anderson at Fort Sumter, raised the first Confederate States flag, and posted the first guards at Fort Sumter. After the siege, he was sent to present the first Confederate flag struck by enemy shot to the Provisional Congress of the Confederate States. He was a lieutenant-colonel and aide-de-camp to General Beauregard during the Battle of Shiloh. During the Battle of Farmington, he was in the 28th Mississippi Cavalry Regiment. He commanded the unit while defending Vicksburg, and helped stop attacks made by U.S. Major-General William T. Sherman and U.S. Commodore David Porter.