Born in Campton, Blair lost his father at two and his mother at twelve. Raised by neighbors on a farm, he attended school when breaks from farm work permitted. Though he never went to college, in 1856, he began reading law with William Leverett at Plymouth, and was admitted to the bar in 1859 and became Leverett's partner.
Blair was appointed prosecuting attorney for Grafton County in 1860.
During the Civil War Blair was rejected by the fifth and twelfth regiments as physically unfit. In 1862, when the fifteenth regiment was formed, he raised a company, enlisted as a Private and was elected Captain. He was appointed Major by the Governor and his Council. After about a year at the front, he held the rank of lieutenant colonel of the Fifteenth Regiment, New Hampshire Volunteer Infantry. During his first battle service, the Siege of Port Hudson, he was wounded twice. After the discharge of his regiment in 1863, he was appointed deputy provost marshal and spent most of the remainder of the war at home as an invalid due to wounds and diseases contracted during the war.
Blair was a member of the New Hampshire House of Representatives in 1866 and a member of the New Hampshire Senate from 1867 to 1868.
Elected as a Republican to the Forty-fourth and Forty-fifth Congresses, Blair served as United States Representative for the state of New Hampshire from (March 4, 1875 – March 4, 1879). In 1876, he introduced the first prohibition amendment to be offered in Congress. He was not a candidate for renomination in 1878 but was elected by the New Hampshire legislature to the U.S. Senate on June 17, 1879, for the vacancy in the term ending March 4, 1885, and served from June 20, 1879, to March 3, 1885. The State legislature not being in session, he was re-appointed on March 5, 1885, and elected on June 17, 1885, to fill the vacancy in the term beginning March 4, 1885, and served from March 10, 1885, to March 4, 1891. He was an unsuccessful candidate for renomination in 1891. While in the Senate. He was chairman of the Committee on Education and Labor during the Forty-seventh through the Fifty-first Congresses. His proposed "Blair Education Bill" advocated federal aid for education but never passed.
Blair declined an appointment by President Benjamin Harrison as judge of the United States District Court for the District of New Hampshire in 1891, but accepted an appointment as Envoy Extraordinary and Minister Plenipotentiary to China on March 6, 1891. The Chinese Government objected to Blair because of his role in passing the Chinese Exclusion Act and declared him persona non grata. He subsequently tendered his resignation from the diplomatic post, which was accepted October 6, 1891.
Again elected to the United States House of Representatives in 1892, Blair served from March 4, 1893 to March 4, 1895, and was not a candidate for reelection in 1894. He engaged in the practice of law in Washington, D.C., until his death.
Blair died in Washington, D.C. on March 14, 1920 (age 85 years, 99 days). He is interred at Campton Cemetery, Campton, New Hampshire.
Son of William Henry Blair and Lois (Baker) Blair, he married Eliza Nelson on December 20, 1859 and they had one son, Henry P. Blair.