(Reuters) - A staunch ally of President Donald Trump, Kris Kobach, won the closely contested Republican nomination for the Kansas governor’s race on Tuesday when incumbent Governor Jeff Colyer conceded the election.

Kobach’s win marks another successful endorsement for Trump, who has weighed in on Republican primaries in several state and federal races, including Georgia’s governor primary, signaling the embattled president remains popular with his base.

Kobach, who serves as the Kansas secretary of state, in the latest tally for the Aug. 7 primary election, had received 128,543 votes, or 345 more votes than Colyer.

“I’ve just had a conversation with the secretary of state and I congratulated him on his success and I repeated my determination to keep this seat in Republican hands,” Colyer said at a news conference.

“This election is probably the closest in America but the numbers are just not there, unless we were to go to extraordinary measures,” Colyer said.

Kansas state law allows for a recount if the vote margin is within half a percentage point, but Colyer decided against making the request.

While Kansas traditionally votes for Republicans at the federal level, the state has traded between Republicans and Democrats in the state capital, and after Brownback passed a series of tax cuts that led to a fiscal crisis, Democrats see an opening to win the race, particularly against the polarizing Kobach.

Slideshow ( 2 images )

Kobach has been a prominent leader of the push to restrict illegal immigration and pass more restrictive voting laws. He advised Trump’s presidential campaign on immigration and served as vice chairman of the president’s short-lived voter fraud commission.

“I look forward to working with Governor Colyer and all Republicans to keep Kansas red in November!” Kobach said in a statement on Twitter on Tuesday.

Colyer had been appointed governor after Sam Brownback vacated the post to join Trump’s administration.

Kobach will face Laura Kelly, who won the Democratic nomination, in November.

Trump won the state over Hillary Clinton in 2016 by about 20 percentage points.