In 1853 he was appointed reporter of the supreme court of Indiana. He joined the Republic Party in 1858 over his disagreement with the Democratic position on slavery. In 1859 he was elected to congress as a Republican, serving on the 36th and 37th congresses, holding his seat until March 3, 1863. On March 5, 1878 he was appointed first comptroller of the United States Department of the Treasury, but he resigned the position to become governor of Indiana, which he was from 1881 until 1885. A clause in the constitution prevented him from seeking reelection that year but he was urged to run in the 1888 election which he declined. In 1889 Porter was appointed U.S. minister to Italy and served in that capacity until 1892.