Blair graduated from the United States Military Academy in 1835, but after a year's service in the Seminole War, he left the Army, studied law, and began practice at St Louis, Missouri, in 1839. In 1836, he married Caroline Rebecca Buckner of Virginia. After her death in 1844, he married Mary Elizabeth Woodbury, daughter of Levi Woodbury. After serving as United States district attorney (1839–43) and as judge of the court of common pleas (1834–1849), he moved to Maryland in 1852 and devoted himself to law practice principally in the United States Supreme Court. He was United States Solicitor in the Court of Claims (1855–58) and was associated with George T. Curtis as counsel for the plaintiff in the Dred Scott v. Sandford case of 1857.