WASHINGTON (AP) " President Donald Trump overruled the warnings of aides Monday to endorse controversial 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.

Colyer did not immediately respond to the endorsement.

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. (They were Republican Clyde Reed in 1930 and Republican Fred Hall in 1956.)

The Trump officials said the president was 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 earlier this month to hold fundraisers for Kobach.

After the 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."

__

Hanna reported from Topeka, Kansas.