He then engaged in trade and studied law, being admitted to the bar in 1826, and practiced successfully in his native town and in Biddeford, Maine.
He was appointed a trustee of Thornton Academy in 1826 and served as president of the board of trustees from 1845 to 1847. He was appointed reporter of the Maine Supreme Judicial Court in 1834, and was then elected to the United States House of Representatives as a Democrat, serving from March 4, 1835, to December 24, 1838, when he resigned, having been elected Governor. He was the 13th and 16th Governor of Maine from 1838 to 1841, and again from 1842 to 1843, when he resigned, having been elected a United States Senator to fill the vacancy caused by the resignation of Reuel Williams.
He was then reelected and served from December 4, 1843 until his death in 1847.
During his time in the Congress he was chairman of the United States. Senate Committee on Naval Affairs for the 29th and 30th Congresses. He was the author of Supreme Court Reports, published in Augusta, Maine between 1835 and 1837.
John Fairfield is the namesake of the town of Fort Fairfield, Maine and also of Governor John Fairfield Elementary School in Saco, Maine.