TOPEKA, Kan. — On the same night that a special congressional election in Ohio proved too tight to call, one of the most competitive Republican primaries for governor this summer was also deadlocked early Wednesday, as Kansas’s most populous county struggled to tally its votes in the race between Kris W. Kobach and Gov. Jeff Colyer.
Mr. Kobach, a hard-right conservative endorsed by President Trump and known nationally for his grim warnings about voter fraud and illegal immigration, sent his supporters home from a watch party in Topeka just before 1 a.m. as he clung to a lead of a few hundred votes over Mr. Colyer, with 88 percent of precincts reporting.
“Try to get a good night’s sleep,” Mr. Kobach, the Kansas secretary of state, told the dozens of supporters who remained past midnight at a Topeka hotel as returns trickled in. “I don’t know if I’ll be sleeping much.”
The long night came amid delays in counting the votes in Johnson County in suburban Kansas City, home to more than 500,000 people, where new voting machines were being used. Mr. Kobach, who in his current position oversees the state’s elections, said the results might not be finalized for hours.
Mr. Colyer, a less polarizing but lesser-known conservative who ascended to the state’s top post earlier this year, was polling ahead of Mr. Kobach in Johnson County with several hundred precincts there still uncounted.
The close results in Kansas came after Mr. Trump upended the race on Monday by endorsing Mr. Kobach against the advice of some of the party’s top strategists.
A victory for Mr. Kobach would again demonstrate Mr. Trump’s ability to influence Republican primaries. But it could also create a general election opening for Democrats, currently shut out of power in deeply Republican Kansas, who believe they can mobilize voters opposed to Mr. Kobach’s strident policies and potentially flip the governorship and two or three congressional seats.
The Republican nominee for governor will face Greg Orman, a businessman running as an independent, and the Democratic nominee, projected by The Associated Press to be Laura Kelly, a state legislator.
Read more about Tuesday’s results:
• Gretchen Whitmer won the Democratic nomination for governor of Michigan, joining women in Georgia, Texas, South Dakota and elsewhere who are competing in November to lead their states.
• In Missouri, voters rejected a legislative move to curb union power.
Kansas has long been among the reddest of red states. Republicans hold all six congressional positions, have carried the state in every presidential election since 1964 and supported Mr. Trump in 2016 by a nearly 21-point margin. Under former Gov. Sam Brownback, a Republican who resigned early this year to become an ambassador, the state became synonymous with a conservative tax-slashing experiment that led to budget cuts and revenue shortfalls.
Mr. Kobach and Mr. Colyer are both politically conservative, though with far different styles and personalities. Mr. Kobach, a Yale-educated lawyer, has for years burnished a national profile by drafting voter I.D. legislation and helping states and cities enact and defend restrictions on voting and immigration. He served as vice chairman of Mr. Trump’s voter fraud panel, which was disbanded after failing to find evidence of the widespread election rigging that the president claimed.
Mr. Colyer served seven years as Mr. Brownback’s lieutenant governor. Since taking over as governor about six months ago, he has tried to broker compromise on a longstanding school funding debate and has signed a law allowing state-contracted adoption agencies to reject gay couples on religious grounds.
Mr. Trump waded into the race to support Mr. Kobach on Monday, a day before the election, against the wishes of many advisers and national Republicans who warned that Mr. Colyer was a safer general election candidate. But the president has had success picking winners in recent Republican primaries, including in South Carolina, Georgia and Alabama, and also felt loyalty to Mr. Kobach, an early supporter of his candidacy and ardent supporter of his immigration views.
Republicans are bracing for a competitive general election. Though rightward-leaning, Kansas is not monolithic, and has elected Democratic governors from time to time over the years.
Discontent with Mr. Brownback’s policies, coupled with suburban skepticism of Mr. Trump, have led to a resurgence of sorts for centrists and liberals. Democrats and moderate Republicans won several seats in the State Legislature in 2016 and undid much of Mr. Brownback’s signature tax policy. They also passed a Medicaid expansion bill, which Mr. Brownback vetoed.
Last year, Democrats came closer than expected to winning a special congressional election in the deeply conservative district that surrounds Wichita. And this year, Democrats believe they have at least a fighting chance in three of the state’s four congressional districts, plus the governor’s race. (The independent candidacy of Mr. Orman, a well-known moderate who ran unsuccessfully for the Senate in 2014 and who Democrats have urged to withdraw, could splinter the vote for governor and give Republicans an advantage.)
In the Second Congressional District, which includes Topeka and the liberal college city of Lawrence, Representative Lynn Jenkins decided to not seek re-election, leaving Republicans without an incumbent in a district that could swing left. Paul Davis, a former lawmaker who ran unsuccessfully for governor in 2014, won the Democratic nomination.
He will face Steve Watkins, a Republican former Army officer who has competed in the Iditarod sled dog race, in the general election.
In the traditionally Republican Fourth Congressional District that surrounds Wichita, Democrats nominated James Thompson, a lawyer and military veteran who lost last year’s special election and who campaigned recently with Senator Bernie Sanders of Vermont and Alexandria Ocasio-Cortez, the surprise winner in a New York House primary in June.
Jonathan Martin contributed reporting from Columbus, Ohio.