Andy Beshear, a Democratic candidate, has a narrow lead with all votes counted and has declared victory over incumbent governor Matt Bevin.
“Tonight, voters in Kentucky sent a message, loud and clear, for everyone to hear,” Mr Beshear, the current Kentucky Attorney General, said in his victory speech.
“It’s a message that says our elections don’t have to be about right versus left, they are still about right versus wrong.”
Matt Bevin, one of the most unpopular governors in the US, has refused to concede.
The governor has repeatedly clashed with teachers in Kentucky. He said he was not conceding by “any stretch” and hinted that he would request a recount.
“We want the process to be followed and there is a process,” he said.
His apparent loss in the deeply conservative state came a day after Mr Trump appeared at a rally in Lexington and pleaded with residents to vote for Mr Bevin.
“If you lose, it sends a really bad message!” Mr Trump said during the event on Monday night.
He said if the Matt Bevin lost, the media would say “Trump suffered the greatest defeat in the history of the world.”
“This would be the greatest [loss],” the president said. “You can’t let that happen to me!”
The party is now in charge of the state’s government, for the first time since 1993.
Pollsters warned against reading too much into individual races but the Democrats’ rising popularity among suburban voters in conservative states is likely to worry the GOP.
Mr Trump has attempted to backtrack and frame the Kentucky governor’s race in a positive tone, despite the loss.
“Our big Kentucky Rally on Monday night had a massive impact on all of the races,” the president claimed on Twitter as the poor result emerged.
“The president just about dragged Matt Bevin across the finish line, helping him run stronger than expected in what turned into a very close race at the end,” Brad Parscale, the president’s 2020 campaign manager, added.
Elsewhere, the US Justice Department said Tuesday’s state and local elections showed no evidence of successful tampering by any foreign government.
Additional reporting by agencies