Kansas Republican Gov. Jeff Colyer conceded late Tuesday to Secretary of State Kris Kobach in one of the most closely contested gubernatorial primaries in years: It saw a mere 345 votes separating the two out of more than 311,000 ballots cast.

Colyer promised to support Kobach (pictured above) in the campaign in an effort to unite a statewide Republican party that has seen more than its share of intraparty fights in recent years.

Colyer was the state’s lieutenant governor for seven years under former Gov. Sam Brownback, whose tenure was marked by conflict over tax cuts, abortion, and budget cutting. Colyer became governor in January when Brownback was confirmed by the Senate as ambassador at large for international religious freedom.

President Donald Trump endorsed Kobach in a tweet the day before the August 7 primary, saying: “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. VOTE TUESDAY!”

Related: Kingmaker Trump Racks Up Impressive Endorsement Record

Kobach was vice chairman of the Presidential Advisory Commission on Election Integrity. He is a strong advocate of aggressive measures to ensure the security and credibility of state election processes.

He will now face Democrat Laura Kelly and independent candidate Greg Orman in the November election. Kansas is a solidly red state, but Democrats have had some statewide successes in recent decades, most recently with Kathleen Sebelius winning two terms as governor between 2003 and 2009. She then was appointed by President Barack Obama as Secretary of Health and Human Services.

But the party has been split in recent years between feuding factions loyal to Sebelius and former Gov. John Carlin. Kelly is a long-time friend of Sebelius and can be expected to benefit from the former governor’s campaign expertise.