Letcher Circuit Judge Sam Wright III defeated Court of Appeals Judge Janet Stumbo in the race for Eastern Kentucky's 7th District Supreme Court seat.
Wright denied Stumbo a return to the state's highest court, where she served for a decade after becoming the first woman elected to the court in 1993.
Wright, 60, has been a circuit judge for more than 20 years, but, unlike Stumbo, he had never run a race throughout the district, which covers 22 counties in far Eastern Kentucky.
Among other things, he advertised heavily on radio to boost his name recognition.
"It's humbling that people believe in you," Wright said of his victory.
Wright advocates for expanding the availability of drug court in Kentucky, and said he hoped to use his experience with drug court in Letcher County to improve that system statewide.
As to what else he wants to accomplish, Wright said, "I want to try to get to what's just."
Wright argued during the race that he would do a better job balancing the rights of accused people and victims during the appeals process, citing cases in which Stumbo overturned criminal convictions.
Stumbo, however, said she decides each case on its merits, with no favoritism for defendants.
The association representing state-court prosecutors endorsed Wright.
Stumbo has spent her career as a judge on the appellate bench and argued that that experience made her the best choice for the job.
Wright, however, said the high court could benefit from his experience making decisions during trials and hearings.
The 7th District seat was open because Justice Will T. Scott resigned to make an unsuccessful bid for the Republican nomination in the May primary.
Tuesday's election was for the unexpired portion of Scott's term, which runs through 2020.
Because the election was for an unexpired term, Wright will take office as soon as the vote is certified, said Leigh Anne Hiatt, spokeswoman for the state Administrative Office of the Courts.
Supreme Court justices are paid $135,504 a year and normally serve eight-year terms.