Harlan was elected as a Whig to the Thirty-third Congress, reelected as an Opposition Party candidate to the Thirty-fourth Congress, and elected as a Republican to the Thirty-fifth Congresses (March 4, 1853 – March 4, 1859).
He was an unsuccessful candidate for reelection in 1858, to the Thirty-sixth Congress and in 1861 to fill a vacancy in the Thirty-seventh Congress. He resumed the practice of law and engaged in agricultural pursuits near Yellow Springs. He served as lieutenant colonel of the Ninety-fourth Regiment of Minutemen of Ohio in 1862.
Harlan moved to San Francisco, California, in 1864 and resided there until his death on January 8, 1868.
He was interred in Laurel Hill Cemetery.