Incumbent Kansas Gov. Jeff Colyer conceded to his opponent, Secretary of State Kris Kobach, in the state’s Republican primary Tuesday night, one week after the extremely narrow vote.

The latest vote tally put Kobach, whom President Trump had endorsed, just 345 votes over Colyer out of more than 311,000 initially counted.

Kobach took to Twitter to thank the governor for his endorsement and his “gracious call” to concede.

The close race called for a lengthy county-by-county review of provisional ballots and resulted in both candidates’ challenging each other's legal interpretations, sending observers to monitor the vote count and raising the specter of lawsuits.

Colyer also questioned whether Kobach — the top election official in Kansas as secretary of state — was advising counties not to count some mail-in ballots, including those with missing or unreadable postmarks.

Kobach removed himself from election-related duties on Aug. 10 until the primary outcome was resolved, but Colyer argued that Kobach still had a conflict of interest because his top deputy took over Kobach's responsibilities.

Kobach rejected Colyer's criticisms, saying his "unrestrained rhetoric has the potential to undermine the public's confidence in the election process."

Trump endorsed Kobach in a tweet the day before the primary: "Kris Kobach, a strong and early supporter of mine, is running for Governor of the Great State of Kansas. He is a fantastic guy who loves his State and our Country - he will be a GREAT Governor and has my full & total Endorsement! Strong on Crime, Border & Military."

Kobach is expected to face Democrat Laura Kelly and independent candidate Greg Orman in the November general election in the decidedly conservative state.

Colyer is a 58-year-old plastic surgeon from suburban Kansas City. He served as lieutenant governor for seven years and took over as governor in January after Sam Brownback resigned to become ambassador-at-large for international religious freedom.

The Associated Press contributed to this report.