Long before he was a conservative folk hero with the support of the president, and long before his strident views on immigration and voter fraud made him a boogeyman to liberals, Kris W. Kobach was an ambitious young Kansan looking for a job in municipal government.

But a political career that began in 1999 with election to the Overland Park City Council — where Mr. Kobach debated the less-than-partisan rudiments of traffic lights, crosswalks and parking lots — quickly pivoted to the more contentious questions of who should be allowed to enter the country and how election systems should be managed.

Mr. Kobach, now the Kansas secretary of state, enters the Republican gubernatorial primary on Tuesday with a far greater national profile — and far more political baggage — than his chief opponent, Gov. Jeff Colyer. (Governor Colyer ascended to his position earlier this year after serving seven years as lieutenant governor to Sam Brownback, who resigned to become an ambassador.)

The primary is being watched far beyond Kansas, both by hard-right Republicans who see Mr. Kobach as a rising political star and by civil libertarians who have clashed with him for years. On Monday, President Trump announced on Twitter that he was endorsing Mr. Kobach, whom he called a “fantastic guy who loves his State and our Country” and is “Strong on Crime, Border & Military.” Democrats believe they have a chance of beating Mr. Kobach in November if he is nominated.