WASHINGTON — President Donald Trump overruled the warnings of aides Monday to endorse hardline conservative Kansas Secretary of State Kris Kobach in that state's Republican gubernatorial primary.

In a morning tweet ahead of the Tuesday contest, Trump said Kobach has his "full & total Endorsement!" as he faces off against a field of candidates that includes incumbent Gov. Jeff Colyer.

"Kris Kobach, a strong and early supporter of mine, is running for Governor of the Great State of Kansas," Trump added. "He is a fantastic guy who loves his State and our Country - he will be a GREAT Governor."

Kobach gained a national profile as an ardent advocate of stricter voter identification laws in his state, including a requirement in Kansas law that new voters provide proof of citizenship when they register that a federal judge recently struck down. His views on immigration policy also align with Trump's and he advised the Trump campaign on a strategy for forcing Mexico to pay for the wall.

Kobach was the most prominent Kansas elected official — and the only one holding statewide office — to publicly endorse Trump ahead of the state's 2016 presidential caucuses. Since Trump's election, he has continued to advise the White House on immigration and homeland security issues.

Two Trump administration officials had told the AP in July that the president had been inclined to endorse Kobach ahead of the state's Aug. 7 primary. But aides have warned the president that it would alienate Republicans loyal to Colyer, who succeeded Sam Brownback when Trump selected him for a diplomatic post.

The officials said the president had been on the verge of tweeting out an endorsement of Kobach last spring, but his staff intervened, warning of the repercussions. They warned that Kobach's hawkish immigration views may make him the weaker candidate in this fall's general election, potentially setting up a prime opportunity for Democrats in the state. The officials believed they had prevailed on Trump to stay out of the race.

Still, Donald Trump Jr., the president's son, visited the Kansas City area in November and Wichita in July to hold fundraisers for Kobach.

An incumbent Kansas governor has lost a primary only twice since the state began holding such elections 110 years ago, the last time in 1956.

Colyer has portrayed himself as a conservative who can build consensus to govern, and he's repeatedly expressed support for Trump, even joining other Republican governors earlier this year in suggesting Trump receive the Nobel Peace Prize. But Kobach has run as a no-apologies conservative who revels in the criticism he provokes on the left.

"We respect the Trump family's loyalty, 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," said Colyer spokesman Kendall Marr.

After the 2016 presidential election, Kobach publicly backed Trump's unsupported claim that "millions" of people voted illegally, costing Trump the popular vote. Trump adviser Kellyanne Conway later identified Kobach as one of the sources of the claim.

And in meeting with the president-elect after the election, Kobach brought a "strategic plan" for the U.S. Department of Homeland Security that included a proposal for revising federal voter registration laws to promote proof-of-citizenship requirements by states like one Kobach championed in Kansas and struck down this year by a federal court.

Trump named Kobach in May 2017 as vice chairman of a presidential commission on election fraud, though the group was disbanded at the start of this year amid infighting and refusals by numerous states to cooperate with its work.

Kobach has continued to praise Trump's economic policies on social media, and on the campaign trail, he echoes Trump's views on illegal immigration, repeatedly making the misleading claim that Kansas is "the sanctuary state of the Midwest."

Kobach and Colyer top a field of seven candidates, and Kansas does not hold runoff elections. That means the Republican nomination could go to someone with 30 percent or less of the vote. In November, Kansas City-area businessman Greg Orman expects to be on the ballot as an independent candidate — making it possible for a candidate to be elected governor with less than 40 percent of the vote.

__

Hanna reported from Topeka, Kansas.