He was elected in 1830 as a Jacksonian (later a Democrat) to the U.S. Senate to fill the vacancy caused by the death of John McLean. He was reelected in 1835 and served from December 11, 1830, until his retirement on March 3, 1841, and was not a candidate for reelection. While in the Senate, he was chairman of the Committee on Engrossed Bills (Twenty-second Congress) and a member of the Committees on Militia (Twenty-second through Twenty-fourth Congresses) and Post Office and Post Roads (Twenty-fourth through Twenty-sixth Congresses).
He served as a U.S. Senator from December 11, 1830, until March 3, 1841, after being elected in 1830 to fill the vacancy left by John McLean's death. He was a member of the Committees on Militia and Post Office and Post Roads during his time in the Senate.