Alarmed by the tight race for a congressional seat in Ohio, Republicans are steeling for a 90-day campaign of trench warfare as they fight to keep control of the House, pinning their hopes on well-funded outside groups and a slashing negative message about Democrats.

Voting across the Midwest and West laid bare the party’s precarious position Wednesday: Ohio’s special election for Congress exposed deep vulnerabilities in the historically conservative suburbs of Columbus, and a Republican candidate there held a fragile lead over his Democratic challenger.

In Kansas, a convulsive nomination fight for governor also remained too close to call the day after the primary, with a hard-right candidate threatening to topple the state’s Republican incumbent and splinter the party down ballot.

And in primaries from suburban Detroit to Seattle, Democrats selected hard-charging candidates in districts long held by the Republican Party.

Republicans believe they can maintain a thin grip on the House by propping up incumbent lawmakers in red-tinged districts and branding the Democrats as wildly left-wing.

But the GOP can afford to lose only 22 seats overall to maintain a majority. That leaves them with painfully little room for error over the remaining three months of the campaign. Veteran party lawmakers have an increasingly bleak view of their prospects in the House, and some fear that Democrats could seize the chamber by a convincing margin.

“There’s a real likelihood that they not only win the House, but they win it by 10 or 12 more seats than they need,” said Sen. Lindsey Graham, R-S.C., voicing publicly what many Republican officials have begun to acknowledge privately this summer.

In Kansas, Republicans faced uncertainty Wednesday not only about their candidate for governor this fall, but also whether they were creating a political opportunity for Democrats to win the office in November. Should the party ultimately nominate Kris Kobach, its hard-right candidate for governor, it could also undermine Republicans in congressional races down ballot.

With all Kansas precincts reporting Wednesday morning, Kobach, the secretary of state, was ahead of Gov. Jeff Colyer by just 191 votes out of more than 311,000 Republican ballots cast. The results were likely to remain in flux for at least several days.

In Ohio, the Republican candidate for Congress, Troy Balderson, was ahead of his Democratic opponent, Danny O’Connor, by 1,754 votes out of more than 202,000 ballots cast — a lead of nearly 1 percentage point. But 3,435 provisional ballots have yet to be counted. Ohio law provides for an automatic recount if the two candidates are ultimately separated by less than half a percentage point.