Kris Kobach, the Kansas secretary of state locked in a tight Republican gubernatorial primary battle against incumbent Gov. Jeff Colyer, said Thursday night that he plans to recuse himself from the vote-counting process.

Earlier Thursday, Kansas election officials revealed that Kobach – who received President Trump’s endorsement – was ahead of Colyer by just 121 votes after two counties reported discrepancies in their initial tallies from Tuesday’s election.

The tightening of the vote count prompted Colyer to issue a letter, demanding that Kobach – the state’s top elections official -- refrain from instructing county election officials on the counting of ballots, and Thursday night Kobach said he would comply with the request.

“I’ll be happy to recuse myself,” Kobach told CNN. “But as I say, it really doesn’t make any difference. My office doesn’t count the votes. The counties do.”

“I’ll be happy to recuse myself. But as I say, it really doesn’t make any difference. My office doesn’t count the votes. The counties do.” — Kris Kobach, candidate for governor in Kansas

Colyer had publicly accused Kobach, the state's top elections official, of giving county election officials information about the handling of yet-uncounted ballots "inconsistent with Kansas law." In his letter, Colyer demanded that Kobach stop advising county officials and have the state's attorney general do the job instead.

Earlier Thursday evening, Kobach had needled Colyer during a Fox Business network appearance, saying it would be "pointless" to remove himself from the process because the state's 105 counties handle the counting of ballots -- but he might do so just to make Colyer "feel good."

But a little more than an hour later, Kobach told CNN: "I said, 'Of course, if he wants me to, I would,’ and he has said, 'OK, I do want you to,' so I will.”

The counting is not complete because state law says mail-in ballots that are postmarked Tuesday can be accepted by the counties as late as Friday. And county officials still must review perhaps several thousand provisional ballots, given to voters at the polls when their eligibility is in question. They have until Aug. 20 to finish.

Colyer released his letter to Kobach after the governor’s campaign announced that it had set up a "voting integrity" hotline and urged people to report their complaints about the election. Colyer spokesman Kendall Marr said it received "countless" reports, adding that he personally knows of several dozen.

"It has come to my attention that your office is giving advice to county election officials — as recently as a conference call yesterday — and you are making public statements on national television which are inconsistent with Kansas law and may serve to suppress the vote in the ongoing primary election process," Colyer said in his letter to Kobach.

In the letter, Colyer questioned whether Kobach was advising counties not to count some mail-in ballots, including those with missing or unreadable postmarks, even if they arrived by Friday. He also said he heard reports that some unaffiliated voters — who by law can declare an affiliation at the polls and vote in a primary — were given provisional ballots instead of the regular ballots they were due.

And Colyer wrote that circumstances "obviously increase the likelihood that one of the candidates may seek a recount, or even the possibility of litigation."

Kobach, a vocal advocate of tough immigration and voter identification policies, advised Trump's campaign in 2016 and the White House afterward and served as vice chairman of Trump's now disbanded commission on election fraud. Trump tweeted his endorsement of Kobach on Monday, less than 24 hours before polls opened.

As secretary of state, Kobach sets rules, gives county officials guidance and appoints election commissioners in the state's four most populous counties. Kobach spokeswoman Danedri Herbert said he would respond to Colyer's letter Friday.

Kobach told reporters Wednesday that he knew of no significant reports of irregularities in Tuesday's primaries, outside of long delays in reporting results from the state's most populous county. There, Johnson County in the Kansas City area, results were delayed by problems with uploading data from new voting machines.

But the totals for the GOP primary for the governor's race in at least two counties posted on the secretary of state's website did not match the totals from the counties themselves.

First, in Thomas County in the state's northwest corner, the final, unofficial results posted on the secretary of state's website show Kobach winning there with 466 votes to Colyer's 422. But the tally posted by the Thomas County clerk's office shows Colyer with 522 votes, or 100 votes more, a number the clerk confirmed to the Associated Press on Thursday.

Bryan Caskey, state elections director, said county officials pointed out the discrepancy Thursday following a routine request for a postelection check of the numbers to counties by the secretary of state's office.

"This is a routine part of the process," Caskey said. "This is why we emphasize that election-night results are unofficial."

Thomas County Clerk Shelly Harms said it's possible that her handwriting on the tally sheet faxed to the secretary of state's office was bad enough in the rush of primary-night business that the number for Colyer wasn't clear. But a copy she provided to the AP showed that the number for Colyer is unambiguously "522."

"They just misread it," she told the AP.

On CNN, Kobach suggested the mistake was among the kind of "keystroke errors" that happen routinely and are caught later.

And in Haskell County, elections officials said they had not initially reported returns from one precinct. Once those votes were added, the net result was a gain of 30 votes.

The Associated Press contributed to this story.