 Stewart was elected as a Democrat to the Thirty-fourth, Thirty-fifth, and Thirty-sixth Congresses, serving from March 4, 1855 to March 3, 1861.During the Thirty-fifth Congress, Stewart served as chairman of the Committee on Patents.Stewart was not a candidate for renomination to Congress in 1860, and resumed the practice of his profession in Cambridge.