He became a follower of Abraham Lincoln during the Lincoln–Douglas debates of 1858. After Lincoln was elected President in 1860, Cannon received an appointment as a regional prosecutor. Cannon, a member of the Republican Party, was elected to the United States House of Representatives from Illinois to the 42nd and to the eight succeeding Congresses (March 4, 1873 – March 3, 1891), and was the chairman of the Committee on Expenditures in the Post Office Department (47th Congress) and of the Committee on Appropriations (51st Congress). Cannon was an unsuccessful candidate for reelection in 1890 to the 52nd Congress, but was elected to the 53rd and to the nine succeeding Congresses that sat between 1893 and 1913.