Gretchen Whitmer, a former Democratic leader in the Michigan State Senate, claimed her party’s nomination for governor on Tuesday, defeating two insurgent rivals and setting up a crucial test for Midwestern Democrats and organized labor in November.
Ms. Whitmer will face Bill Schuette, the state attorney general and the longtime front-runner on the Republican side, in the general election. Republicans have dominated Michigan for most of the last decade and President Trump carried the state narrowly in 2016. The governorship is a vital prize for Democrats seeking a comeback there.
The most closely watched contest of the night, however, was next door in Ohio, where a solitary special election for a conservative-leaning House seat outside Columbus became in recent weeks a momentous test of wills between the two national parties.
By 10 p.m. Tuesday, with most of the votes counted, the Republican candidate, State Senator Troy Balderson, and the Democrat, Danny O’Connor, were running almost even.
Voters in Ohio’s 12th District, a largely suburban seat that has been loyally Republican for decades, were choosing a replacement for Pat Tiberi, a former lawmaker who resigned abruptly to join the private sector.
National Republicans have spent millions there and President Trump visited the district over the weekend in an effort to pull Troy Balderson, a state senator, to victory against Danny O’Connor, a 31-year-old Democrat who is a local official in Franklin County, the most Democratic-leaning part of the district.
Mr. Balderson’s struggles in the race have been a vivid study in the tribulations of Republican congressional candidates under Mr. Trump, and the race is seen as a test of whether a powerful onslaught from national Republican groups can keep a once-reliably red district in line.
In Kansas, Republicans were also hurtling to the end of a bruising primary for governor: Jeff Colyer, the Republican incumbent, appears at dire risk of losing the G.O.P. nomination to Kris Kobach, a hard-right state official whom Mr. Trump endorsed on Monday. Republican leaders in the state that Mr. Kobach, who is best known for supporting voting restrictions and strenuously opposing immigration, could put the office at risk in the general election.
There were also important congressional primaries across the map, including in a half-dozen districts in Kansas, Michigan and Washington State that are expected to be intensely contested in November. In the race for a United States Senate seat in Michigan, John James, a businessman and Army veteran who is African-American, won the Republican nomination to face the Democratic incumbent, Debbie Stabenow.
And in Missouri, Republicans nominated Josh Hawley, the state attorney general, as their challenger against Senator Claire McCaskill, a vulnerable Democrat. Mr. Hawley dispensed with a handful of gadfly primary opponents; he has the muscular backing of the national G.O.P. establishment.