Rogers served solicitor of the Raleigh district of the superior court. During the American Civil War, he served in the Confederate States Army as a lieutenant in the Fourteenth Regiment of North Carolina State Troops in 1861; was commissioned colonel of the Forty-seventh North Carolina Infantry April 8, 1862, and resigned January 5, 1863, upon being elected attorney general of the State of North Carolina.
Rogers served as North Carolina Attorney General until 1866. In 1868, he stood for election to Congress once more, but was unsuccessful. He was, however, elected as a Democrat in 1868 to the 41st United States Congress, where he again served a single-term (March 4, 1871 - March 3, 1873). Rogers failed to gain re-election in 1872 and died in Raleigh on August 14, 1874; he is buried in the City Cemetery in Raleigh.