(Reuters) - The Republican candidate endorsed by U.S. President Donald Trump in the Kansas governor’s race, Kris Kobach, saw his lead cut to only 91 votes on Thursday after a county clerk corrected the vote total from Tuesday’s election.

FILE PHOTO: Kansas Secretary of State Kris Kobach talks about the Kansas voter ID law that he pushed to combat what he believes to be rampant voter fraud in the United States in his office in Topeka, Kansas, U.S., on May 12, 2016. REUTERS/Dave Kaup/File Photo

Kobach, the current Kansas secretary of state and a staunch ally of Trump, now leads current Governor Jeff Colyer in the Republican primary by a razor-thin margin of 126,257 to 126,066 with potentially thousands more provisional and absentee ballots outstanding.

“The discovery of this error shows the importance of getting this right. This is why you have canvas, this is why you check your math, and this is exactly why Gov. Colyer will ensure that every vote is counted fairly and accurately,” Colyer’s director of communications, Kendall Marr, wrote on Twitter.

Thomas County Clerk Shelly Harms confirmed to Reuters that Colyer’s vote total had been corrected to 522, up 100 votes from the 422 initially reported.

Both candidates are listed as having 41 percent of the vote in the contest, which is seen in part as a test of Trump’s popularity in the Midwestern state.

Kobach is a national leader of the push to restrict illegal immigration and pass more restrictive voting laws, advised Trump’s presidential campaign on immigration issues and served as vice chairman of his short-lived voter fraud commission.

In a tweet, Trump called Kobach “a strong and early supporter of mine” and said he had the president’s “full and total” endorsement. “Strong on Crime, Border & Military. VOTE TUESDAY!” Trump wrote.

Trump made no mention of the voter fraud commission in his endorsement, but Kobach was the leading proponent of a theory backed by the president that millions of fraudulent votes were cast in the 2016 presidential election.

A federal court ruled against Kobach’s claims of voter fraud in April and held him in contempt for violating an injunction meant to safeguard voting rights.

Colyer, the former lieutenant governor, moved into the top job earlier this year when Republican Sam Brownback took a job in the Trump administration as a religious freedom ambassador.

Kansas state law allows for a recount if the vote margin is within half a percentage point, but the candidate has to request the recount. The candidate who requests the recount must pay for it if the results are unchanged by that process, Kobach has said.