 Underhill was elected as a Whig to the Thirty-first Congress, holding office from March 4, 1849 to March 3, 1851.He was not a candidate for renomination in 1850.Underhill advocated an end to slavery, and also supported efforts to have former slaves settle in Liberia, with compensation paid to their former owners.