President Trump on Monday endorsed Kris Kobach in Tuesday’s GOP gubernatorial primary in Kansas — backing the man who championed his discredited claim that up to 5 million illegal immigrants voted in the 2016 election.

“Kris Kobach, a strong and early supporter of mine, is running for Governor of the Great State of Kansas. He is a fantastic guy who loves his State and our Country — he will be a GREAT Governor and has my full & total Endorsement! Strong on Crime, Border & Military. VOTE TUESDAY!” the president tweeted from his golf resort in New Jersey.

Kobach, Kansas’ secretary of state, is challenging the Republican incumbent, Gov. Jeff Colyer.

He had led Trump’s voter fraud commission, which unsuccessfully sought to prove that there was widespread election fraud across the US that the president said cost him a win in the popular vote.

But the commission was shut down in June after failing to uncover evidence supporting the commander-in-chief’s claim.

Kobach is a far-right conservative who has the support of nationalists but has been condemned by left-leaning groups including the ACLU and civil right organizations.

And despite his commission’s inability to prove it, he still believes that voter fraud is widespread in America.

“Every time a non-citizen votes, it effectively cancels out the vote of a US citizen,” he said recently. “That’s a problem.”

In federal court in March, experts tore apart his claims that non-citizens were guilty of widespread voter fraud, and the judge who tried the case ruled against him, NPR reported.

Kobach was held in contempt in the same case for violating an injunction meant to safeguard voting rights, was charged lawyer fees and fined for misleading a judge.

Colyer has attacked Kobach for his quixotic crusade.

“There is only one candidate on this stage,” he said at a recent debate, “who has been fined by a federal judge for lying to a federal court.”

Seven candidates are seeking the GOP nomination in Tuesday’s primary, and the winner need not get a majority, just the highest percentage.

At Washburn University in Topeka, political scientist Bob Beatty told the network that that meant Kobach’s base could be his ticket to victory.

“His strategy, and it may be a very good one, is, ‘I don’t need to change anybody’s mind,’ “ Beatty said. “ ‘I just need to get my people out.’ “

Polls show a tight race, with a Remington Research Group survey released Monday showing Colyer with a narrow lead over Kobach, 34 percent to 32 percent. No one else topped 14 percent.

Kobach has vehemently denied that his voter fraud position is aimed at minorities.

“I don’t have a racist bone in my body. I believe we are all God’s children,” he said.

But Kobach has repeatedly charged that Somali refugees stole a 2010 election in Kansas City — even though a court dismissed his claims as unfounded.