Thornton was elected as a Democrat to the Thirty-ninth Congress (March 4, 1865 – March 3, 1867). He was not a candidate for renomination in 1866. He resumed the practice of law. He served as justice of the Supreme Court of Illinois from 1870 to 1873, when he resigned. He served as president of the Illinois State Bar Association for four terms. He served as chairman of the State board of arbitration 1895–1897. He died in Shelbyville, Illinois, on September 10, 1904. He was interred in Glenwood Cemetery.