He was elected a member of the Maine State Senate,and was elected to the Nineteenth and Twentieth Congresses and elected as a Jacksonian to the Twenty-first and Twenty-second Congresses (March 4, 1825 – March 3, 1833). He was chair of the Committee on Elections (Twentieth Congress), and chair of the Committee on Naval Affairs (Twenty-second Congress). He was not a candidate for renomination in 1832.
He was elected Mayor of Portland 1833-1836 and again in 1842. He was appointed Maine United States Attorney 1833-1836. He was appointed collector of customs for the Port of Portland 1837-1841 and 1843-1848. He resumed the practice of law, and died in Portland August 21, 1853. His interment was in Town Cemetery (then a part of the farm of his ancestors) in Windham, Maine.