Former associate circuit judge Ben Lewis defeated incumbent judge John Heisserer by 272 votes on Tuesday.
"I've won and I've lost and winning is better," Lewis said.
Overall, Heisserer won 23,383 votes to Lewis's 23,655.
Lewis, a Republican, was elected to the bench in 1990 and was defeated for re-election in 1994.
Lewis said he now plans to wind up his private practice.
"I've got some lawsuits to try between now and the end of the year," he said. "I'll have to get ready to go back on the bench. I'm looking forward to it."
Heisserer, a Democrat, narrowly carried Cape Girardeau and Perry counties, but Lewis captured enough votes in Bollinger County to make the difference.
Heisserer said he does not plan to ask for a recount.
"Certainly it's very close, but I have no reason to think the count was not accurate," he said.
Heisserer said he called Lewis to congratulate him and pledged his cooperation in making a smooth transition.
Connect with the Southeast Missourian Newsroom:
For corrections to this story or other insights for the editor, click here. To submit a letter to the editor, click here. To learn about the Southeast Missourian’s AI Policy, click here.