Republican incumbent Gov. Matt Bevin refused to concede late Tuesday in Kentucky's gubernatorial race, citing "irregularities" -- potentially kickstarting weeks of uncertainty and legal battles as the closely-watched contest with national implications remains too close to call.

With 100 percent of precincts reporting, Bevin was behind Democratic Attorney General Andy Beshear, 49.2 percent (711,955 votes) to 48.9 percent (707,297 votes). Libertarian candidate John Hicks received 28,475 votes, or 2.0 percent.

The Associated Press said it could not declare a winner. Kentucky law provides for three levels of post-election procedures: a recanvass, a recount, and an election contest.

Kentucky candidates have a week from Election Day to file a request for recanvassing with the Secretary of State. If a recanvassing happens, the county election boards will recheck each machine and report the figure back to the county clerk. The law allows a representative from both campaigns to be present as the recanvassing occurs.

The recanvassing process simply checks each machine to make sure that the numbers reported to the State Board of Elections were not misreported or incorrectly added.  Ballots themselves are not recounted; instead, a recanvass is simply a way to double-check that the machines tallied the votes correctly. Recanvassing is unlikely impact the results.

There is no automatic recount process in Kentucky. Instead, a challenger must file a petition with the Franklin Circuit Court, by Nov. 13, to seek a formal recount.  The challenger would have to front the cost of the recount.  A Kentucky judge would manage the recount procedure.

That judge would take possession of the voting machines and paper ballots and would conduct his or her own recount of the ballots.  As about one-thirds of Kentucky voters use an electronic voting machine with no paper trail, in a “recount” of these votes the judge would simply check the count of the machine once again – making it more like a recanvass, at least for these ballots.  But for the other two-thirds of voters, the judge can actually recount each ballot.  The judge’s decision on who won would be final, subject to possible appeal to the Kentucky Court of Appeals or even the Kentucky Supreme Court.

Then there’s an election contest. Once again, the challenger would have to request one by November 13, so he might do so in conjunction with his request for a recount.  An election contest is even more judicial in nature, as the challenger would have to specify the grounds for the action – such as some form of “corrupt practice” like a violation of state campaign finance rules or particular issues with the vote casting process.

Although Trump carried deep-red Kentucky by 30 points in the 2016 presidential election, Bevin is unusually unpopular for a Republican in the state, owing in part to his numerous spats with public school teachers and his plan to address a growing pension crisis.

Bevin was significantly underperforming the rest of the GOP ticket on the ballot in Kentucky on Tuesday, as Republican candidate Daniel Cameron handily won his race to become the state's next attorney general. He made history as the first African-American to be elected Kentucky Attorney General and the first Republican to hold the post in more than 70 years.

In a major indicator that Bevin is unpopular among Kentuckians, Cameron received 774,864 votes in his 15-percentage-point win -- while Bevin garnered only approximately 700,000 votes for his marquee gubernatorial bid. It is highly unusual for down-ballot races to attract more voter interest than gubernatorial contests.

Meanwhile, Republican attorney and former elections board member Michael Adams was easily elected as Kentucky’s next secretary of state, and Republican Mike Harmon was re-elected as Kentucky auditor. Additionally, Republican Ryan Quarles was re-elected as Kentucky commissioner of agriculture, and GOP incumbent Allison Ball won a second term as Kentucky’s treasurer.

In a worrying sign for Republicans in the long term, Bevin underperformed in Northern Kentucky, typically a GOP stronghold, and among suburban voters in several counties outside of Cincinnati.

Apparently aware of his problems with voters, Bevin had remarked in February, "There has never been a poll ever taken since I’ve been a candidate or since I’ve been governor ... that has ever found me above water on anything or likely to win anything, ever. ... Polls, shmolls."

Also on Tuesday, Virginia Democrats took control of the state Senate for the first time in five years, as the state continues its dramatic leftward shift. Results were still pending in several state House races, where the GOP holds a slim majority.

In Mississippi, GOP candidate Tate Reeves was well ahead of Democratic candidate Jim Hood, with only 15 percent of precincts reporting. Results were still coming in late Tuesday, and the race -- the state's tightest governor's race in years, according to polling data -- was too early too call.

Headlining a fired-up rally at Rupp Arena in Lexington on Monday night, Trump jokingly acknowledged that the elections could be seen as a barometer of his popular support amid Democrats' impeachment inquiry. If Republicans triumphed, Trump remarked, the media would cover it as a "ho-hum" event -- but if Democrats won, the day would be portrayed as a major loss for the White House. Read more at FOX News