After surrendering at Appomattox Court House, he was paroled at Winchester on May 30, 1865, and received a presidential pardon on August 19, 1865.
After the war, James Keith resumed his law studies under John M. Forbes, a prominent lawyer in Warrenton.
Fauquier County voters elected Keith to the Virginia House of Delegates in 1869 and he served in the session of 1869—70.
In late 1870, he was elected as judge of the Eleventh Judicial Circuit, composed of Alexandria, Fauquier, Fairfax, Loudoun, Prince William and Rappahannock counties.
[8] The Virginia Historical Society has some Keith family papers, maintained by Fanny Scott, the wife of Virginia Attorney General Robert Taylor Scott, and who led the Black Horse Chapter of the United Daughters of the Confederacy at Warrenton (the unit which had both sons of Judge Isham, and where that Judge Keith died and was buried).