The gubernatorial candidates in Kentucky are tied just two weeks ahead of a critical election which could signal whether President Trump still has significant support in Republican-controlled states. Republican Governor Matt Bevin and Democrat Andy Beshear are deadlocked at 46% each, according to a new poll by Mason-Dixon Polling.

The poll is a windfall for Bevin, who is facing a serious challenge from Beshear, the current attorney general. Bevin is unpopular in Kentucky, and has sparred with the state's powerful teachers unions. However, the latest poll, by Mason-Dixon showed that Bevin's unfavorable rating among registered and likely voters is 48%, and his favorable rating is 45%.

Bevin's advantage here is tied to his vocal support for President Trump, who has a 57% approval rating in Kentucky and won the state by 30 points in 2016. The feeling is mutual — Mr. Trump tweeted last week that Bevin has his "Complete and Total Endorsement."

Get Breaking News Delivered to Your Inbox

"Matt is Strong on Crime and the Border, he Loves our Great Vets and Military. Matt has my Complete and Total Endorsement, and always has!" Mr. Trump wrote.

Vice President Mike Pence is slated to travel to Kentucky to campaign on Bevin's behalf early next month, and Mr. Trump will appear at a rally in Lexington the night before the election.

Bevin has highlighted his strong relationship with the president throughout his campaign, and has largely focused his campaign ads on national issues which motivate Republican voters, such as immigration and abortion.

One 30-second ad launched by the Bevin campaign in September accuses Beshear of supporting sanctuary cities and evokes imagery of the notorious Central American gang MS-13.

The ad highlights Bevin's ties to Mr. Trump while raising one of the president's signature issues. Although Kentucky is far from the southern border, illegal immigration is an issue that reliably motivates Mr. Trump's base.

Bevin told reporters in September that illegal immigration is not "a huge issue for us as a state, but it's a concern for this country," according to the Associated Press.

"Surprisingly for a state that's not a border state, it comes up time and time again near the top of people's lists," Bevin said in September. "And I think in some measure driven by the fact that nationally it's very topical. I think people believe that we should have immigration but it should follow the law."

Bevin has also pushed impeachment to the forefront of the campaign, harshly condemning the impeachment inquiry against Mr. Trump. According to the Mason-Dixon poll, this strategy may be successful in amping up Republican voters — 65% of those polled do not support the impeachment and removal of Mr. Trump from office.

Davis Paine, Bevin's campaign manager, said in a statement that "the Bevin campaign has the momentum."

"With two weeks remaining, voters are beginning to tune in and find out just how liberal Andy Beshear is, whether it's his opposition to President Trump and silence on impeachment, his refusal to ban sanctuary cities, or his pro-abortion agenda and abortion lobby backers," Paine said.

Amelia Chasse Alcivar, spokesperson for the Republican Governors Association, agreed that "the governor's strong record of expanding economic opportunity and upholding Kentucky values provides a clear contrast to Andy Beshear's liberal, big-government agenda — and voters are taking note."

However, David Turner, spokesperson for the Democratic Governors Association, downplayed the poll's results.

"I'm not sure the public polling is the arbiter of truth. He's still deeply unpopular. We always knew it was going to be close, Kentucky is a ruby red state. We have the resources and were prepared for the eventuality that it will be a close race," Turner said. "Beshear is finishing his campaign strong, Bevin is finishing flailing and desperate."

Sam Newton, a spokesperson for Beshear and running mate Jacqueline Coleman, said "there's nothing that will make Kentuckians forget how Matt Bevin's attack public education, tried to illegally cut pensions, and insulted teachers." Newton pointed to endorsements in the past couple of months from the Kentucky Fraternal Order of Police and Republican primary candidate William Woods.

"Under Bevin, too many families across Kentucky are making less every year, and Bevin is still refusing to support protections for people with pre-existing health conditions. Working families are ready for a governor who will be in their corner and Andy Beshear has proven he'll work with anyone to get the job done," Newton said.

The gubernatorial election in Kentucky is one of three elections in red states which could be bellwethers for the strength of Mr. Trump's support in 2020. Democratic Governor John Bel Edwards is facing reelection in Louisiana, and there is an open seat for governor in Mississippi.

If Bevin can hold on in Kentucky, if Edwards is toppled in Louisiana, and if Republican Tate Reeves wins the Mississippi governorship, it's likely to be received as a sign that Mr. Trump still has significant currency in these states.

Aaron Navarro contributed to this report