He was elected as a Democrat to the Thirty-eighth Congress, defeating Republican Roscoe Conkling, and served from March 4, 1863 to March 3, 1865. In Congress he rendered important service as a member of the judiciary committee. In 1864, he was defeated for re-election by Conkling. Their political differences did not interrupt a warm personal friendship. As a member of the New York Assembly and the U.S. House during the American Civil War, Kernan was a prominent War Democrat, and was thoroughly in accord with the national government in its efforts to maintain the integrity of the Union. He was instrumental in having the per capita tax on emigrants declared unconstitutional. In 1871, Kernan was an ally in Samuel J. Tilden's efforts to overthrow the Tweed ring.