He worked to encourage the migration of Republicans and European emigrants to the Ohio Valley counties of Virginia. (These counties would become West Virginia when Virginia seceded from the Union in 1861.) His efforts met with little success and then vanished completely in October 1859 in the aftermath of John Brown's raid on Harper's Ferry, when the Black Horse Cavalry searched and confiscated the Underwoods' Virginia property by order of Governor Henry A. Wise. Only Maria and the children lived there at the time; Underwood had been permitted to return only temporarily to settle his affairs after giving his pro-Fremont speech. The "Wheeling Daily Intelligencer," which Underwood supported financially, became the most influential Republican paper in any major slaveholding state. In 1860, Underwood was a delegate to the Republican Convention in Chicago, Illinois that selected Abraham Lincoln as its candidate. He campaigned for Lincoln in border states, and on October 17, 1860, made possibly the only speech in favor of that Republican candidate in Virginia, in Bellton, (now West Virginia). The "New York Tribune" published that endorsement speech, which extolled the superiority of free over slave labor, about a week later. In 1861, although the Senate approved Underwood's appointment to the position of United States Consul at Callao, Peru, Underwood declined the post, accepting instead the office of fifth auditor in the United States Department of the Treasury, a position in which he served from 1861 to 1864, under Treasury secretary Salmon P. Chase. He lived in Alexandria, Virginia, and Washington, D.C., for the rest of his life. Underwood received a recess appointment from President Abraham Lincoln on March 27, 1863, to a seat on the United States District Court for the Eastern District of Virginia vacated by Judge James Dandridge Halyburton. He was nominated to the same position by President Lincoln on January 5, 1864. He was confirmed by the United States Senate on January 25, 1864, and received his commission the same day. Underwood was reassigned by operation of law to the United States District Court for the District of Virginia on June 11, 1864, to a new seat authorized by 13 Stat. 124. Underwood was reassigned by operation of law to the United States District Court for the Eastern District of Virginia on February 3, 1871, to a new seat authorized by 16 Stat. 403. His service terminated on December 7, 1873, due to his death. In this position, in May 1866, Underwood presided over the grand jury that indicted Confederate president Jefferson Davis for treason, and later denied him bail because he was in the custody of military authorities.