TOPEKA, Kan. — Kris W. Kobach, the hard-charging Kansas secretary of state, has long raised concerns about the integrity of America’s elections. He has warned the president that there is rampant voter fraud, crusaded for stringent voter identification laws and tried unsuccessfully to convince a federal judge that the handful of Kansans he caught voting illegally were merely “the tip of the iceberg.”

Now Mr. Kobach, who oversees the state’s elections, finds himself in charge of a closely watched Republican gubernatorial primary that is far too close to call. Just 191 votes separated the two candidates on Wednesday with all precincts reporting. Some mail-in and provisional ballots were yet to be counted. A lengthy recount process seemed likely.

The candidate holding the razor-thin lead? Mr. Kobach himself.

This awkward coda to the long, tense primary campaign between Mr. Kobach and the sitting governor, Jeff Colyer, threatens to further divide long-feuding Kansas Republicans. Even before Tuesday’s voting Republicans had feared that Mr. Kobach’s nomination could imperil their hold on the governorship and a pair of congressional seats in November’s election.

And now it forces Mr. Kobach toward an uncomfortable choice: Recuse himself from one of his office’s most important tasks, or oversee a sensitive and critical process where conflict of interest questions are unavoidable.