during the american civil war, spencer enlisted as a captain on october 16, 1862. while serving on the staff of brig. gen. grenville m. dodge, he requested a transfer to the 1st alabama cavalry regiment, a volunteer regiment made up of southern unionists, which did not have a permanent commander. receiving a promotion to colonel, he led the regiment from september 11, 1863 until his resignation on july 5, 1865.