President Donald Trump injected his influence into the Kansas governor’s race Monday, endorsing Kris Kobach in his hotly contested primary challenge a day before the election.

Polling shows the secretary of state locked in a virtual tie with Gov. Jeff Colyer as they scramble to woo undecided Republican voters in the final hours of the campaign.

Kobach is a close ally who talks regularly with the president and twice welcomed Donald Trump Jr. to stump for him in Kansas.

“He is a fantastic guy who loves his State and our Country,” Trump said. “He will be a GREAT Governor and has my full & total Endorsement! Strong on Crime, Border & Military!”

Bob Beatty, a political science professor at Washburn University, said the endorsement won’t change people’s minds about the candidates in the race, where former state Sen. Jim Barnett and Insurance Commissioner Ken Selzer are acting as potential spoilers.

The value of the endorsement, Beatty said, is the potential to motivate Trump supporters to show up at polls.

“The bigger question is the impact at this point,” Beatty said. “It could have been more helpful a little bit earlier, which would allow Kobach to blast the endorsement all over his TV ads.”

As of Saturday, about 50,000 Republican voters already had cast ballots in advance of Tuesday’s election.

Kobach, who said he and Trump regularly check in with each other on how things are going, said the news will provide a boost to his campaign. He thanked the president for “putting his faith and trust in me.”

“He’s been thinking about it for quite some time,” Kobach said. “I knew that if he did endorse it would probably be late in the day. And obviously, it comes at a great time. I actually think Monday before an election is probably the best time to have an endorsement because you have a relatively slow news day. You still have some undecideds who are finally thinking, ‘OK, I better figure out who I’m going to vote for.’ So it’s actually great timing.”

Colyer routinely praised Trump in debates, campaign speeches and news releases. In May, Colyer joined six other governors in signing a letter nominating Trump for the Nobel Peace Prize in recognition of his efforts to bring peace to the Korean peninsula.

“We respect the Trump family’s loyalty,” said Kendall Marr, a spokesman for the governor, “but as Bob Dole made clear in his endorsement of the governor, Dr. Colyer is the best candidate to win tomorrow and is the only candidate who can defeat the democrats in the fall.”

Kobach backed the future president during his campaign for the GOP nomination in 2016. He met with Trump immediately after the election, when he was seen with documents outlining his ideas for the Department of Homeland Security, and the president chose Kobach to lead his voter fraud commission. In a conversation for Capitol Insider podcast, Kobach said he turned down offers to be an adviser in the White House and senior official at Homeland Security.

Beatty said the willingness of the president to get involved is likely an indication that someone made the argument to him that his influence was needed in a close race. The Associated Press reported Trump aides tried to prevent the endorsement because they worried it would alienate Republicans loyal to Colyer, who became governor when Trump selected former Gov. Sam Brownback for a diplomatic post.

“He went with his gut,” Kobach said, “and President Trump’s gut is almost always exactly spot on.”

Kobach’s most recent polling, which is about a week old, gave him a 34-25 edge over Colyer in the race with 20 percent undecided. Colyer released a new poll conducted over the weekend that gives the governor a 34-32 advantage with 10 percent yet to make up their minds. Nine percent back Selzer, and 14 percent said they would vote for Barnett.

Selzer was skeptical of the value of Trump’s endorsement, saying most voters are focused on Kansas issues.

“We do not believe it will have much impact,” Selzer said.

Patrick Miller, an assistant professor of political science at the University of Kansas, said even a small impact could make the difference in the election. There isn’t a one-to-one relationship between Trump and Kobach support, Miller said.

“It’s hard to gauge where the endorsement falls between a neutral to a net positive,” he said. “If this moves a hundred more Republicans to show up or decide that Kobach is their candidate, then it matters, especially in a close race.”

Trump staff members, according to the AP, warned that Kobach could be a weaker candidate in the general election and believed they had prevailed in keeping Trump out of the race. The Kansas Democratic Party seized the opportunity for a fundraising drive.

“We know how disastrous a Kobach administration would be for Kansas — Kobach’s promising to double down on the failed Brownback tax experiment, and he’ll continue to be a national embarrassment for Kansans,” the party said in a statement it issued to supporters, asking them to chip in $5, $20 or $35.

State Sen. Laura Kelly, a Democrat from Topeka, honed in on Kobach’s interest in rolling back tax increases that undermined the supply-side policy favored by Brownback. Kelly faces former agriculture secretary Josh Svaty and Wichita Mayor Carl Brewer as front-runners for the party’s nomination.

“Kansans are ready to put the Brownback experiment behind us once and for all,” Kelly said. “If elected in November, Kris Kobach will only continue the mistakes of the past and decimate our state further. It’s time to come together and elect a governor who will fight for Kansas families and invest in our future.”