 He was elected as a Whig to the 31st United States Congress to fill the vacancy caused by the resignation of Robert C. Winthrop, and served from August 22, 1850 to March 3, 1851; he declined to be a candidate for renomination in 1850.He was treasurer of Harvard University from 1842 to 1853.He published a "Sketch of the History of Harvard College and of its Present State" (Boston, 1848), and edited selections from the sermons of Dr. Francis W. P. Greenwood, with a memoir (2 vols., Boston, 1844).