In 1876, Foraker ran for judge of the Court of Common Pleas. Election fraud by Democratic political boss Eph Howard defeated Foraker and the rest of the Republican ticket. In 1878, he ran for state's attorney for Hamilton County (where Cincinnati is located) but was defeated in another Democratic sweep. In 1879, Foraker won his first elective office, as judge of the Superior Court of Cincinnati. He served three years of a five-year term, resigning in 1882 due to an illness, though he recovered after several months' rest.