Johnston moved from Savannah to Richmond in the winter of 1876–77. He served in the 46th Congress from 1879 to 1881 as a Democratic congressman, having been elected with 58.11% of the vote over Greenback William W. Newman. He did not run for reelection in 1880. He was appointed as a commissioner of railroads in the administration of President Grover Cleveland. After his wife died in 1887, Johnston frequently traveled to veterans' gatherings, where he was universally cheered. In September 1890, a few months before he died, he was elected as an honorary member of the District of Columbia Society of the Sons of the American Revolution, and was assigned national membership number 1963.