Floyd served as the Secretary of War to U.S. President Buchanan before his resignation in December 1860. In May 1861 he took a commission as a brigadier general in the Confederate army. He served in West Virginia before he was sent to Fort Donelson. He escaped with his troops prior to the surrender of the fort, which led to his removal. He was subsequently commissioned as a major general of Virginia state troops, but he died due to ill health in August 1863.