Republican Matt Bevin defeated Democrat Barack Obama in the race for Kentucky governor.

At least, that’s what it seemed like.

The Tea Party conservative repeatedly pissed off Republicans after winning May’s GOP primary by just 83 votes, and the Republican Governors Association pulled its advertising support in September.

Polls showed Kentucky’s attorney general, Jack Conway, winning the race all the way up to last week — but somehow Bevin, by all accounts an atrocious candidate, soundly defeated his Democratic rival in the low-turnout election.

ADVERTISEMENT

Thanks, Obama.

The RGA returned with $1 million in ads for the final two weeks of the race, and those TV spots essentially switcherooed Conway for Obama — who is deeply unpopular in Kentucky.

Bevin promised during his campaign to dump about 10 percent of Kentucky’s population off Medicaid, after Democratic Gov. Steve Beshear expanded health care coverage under Obama’s Affordable Care Act — although, of course, he denied it.

“Kentucky has seen the nation’s steepest drop in uninsured residents,” said HBO’s John Oliver earlier this week. “Only an idiot would try to undo that — which brings me to gubernatorial candidate Matt Bevin.”

He has since softened his position a bit and said he would move about 420,000 newly covered Kentuckians off the state-run exchange and onto the federal exchange before repealing the Medicaid expansion overseen by his predecessor.

Bevin did not win Rowan County — although its most famous resident was “ecstatic” over his victory.

ADVERTISEMENT

He threw his support behind Kim Davis, the Rowan County clerk, during her fight to disobey the U.S. Supreme Court ruling on same-sex marriage without suffering any consequences.

Bevin questioned why the government was involved in issuing marriage licenses in the first place, and he suggested a compromise sought by another defiant county clerk that would require Kentuckians who wanted a marriage license to download the form and print it out from a website set up and maintained with taxpayer support.

That assumes that all Kentuckians have access to computers, printers, cars or libraries — which isn’t the case in many poorer, rural areas.

ADVERTISEMENT

And besides, Bevin’s Tea Party buddies have been trying to defund county libraries over a technicality.

Entering the race, Bevin was best known for the clumsy lies he told during his unsuccessful GOP primary challenge last year against Sen. Mitch McConnell.

ADVERTISEMENT

“Republicans called Matt Bevin an ‘East Coast Con Man’ and a ‘Pathological Liar’ (during last year’s campaign), but he can’t deny what he put in print: Bevin supports a ‘repeal’ of Medicaid that would kick nearly 500,000 Kentuckians off of their health care,” said state Democratic spokesman David Bergstein.

His LinkedIn account inaccurately claimed an education from the Massachusetts Institute of Technology, which screen shots clearly demonstrate, but Bevin flatly denied the reference and said it had been made up as “an absolute lie” by the McConnell campaign.

Bevin also denied his involvement in a rally last year to legalize cockfighting in Kentucky — until a reporter confronted him with video evidence of the candidate expressing his support for the illegal sport as a state’s rights issue.

ADVERTISEMENT

The Republican also ran on his opposition to Common Core, which many conservatives believe is a liberal or Islamic conspiracy — although a company partly owned by Bevin sells education software that closely matches the federal education standards.

He also lied repeatedly through both campaigns about whether he had been delinquent on property taxes he owed in Louisiana and on a vacation home in Maine.

But in Kentucky, shaking your fist at President Barack Obama from a Chick-Fil-A parking lot is evidently enough to get even a bumbling, craven liar like Matt Bevin elected governor.