Republicans declared victory late Tuesday in a still-unresolved race for a solidly red congressional district in Ohio, a contest that exposed growing concern over the vulnerabilities in President Trump’s governing coalition.

The race was the latest example of increased Democratic energy and tepid Republican candidate performance that has defined recent special elections, including House races in Arizona and Pennsylvania and a Senate race in Alabama.

Despite Republicans dramatically outspending Democrats and a last-minute visit by Trump, Republican state Sen. Troy Balderson received just 1,754 more votes than Democrat Danny O’Connor, an elected county recorder, with thousands of provisional votes still outstanding.

The margin of less than 1 percent came in a district that Trump won by 11 points in 2016 and where Republicans have held control since 1983. If the vote difference tightens further, it could trigger an automatic recount under Ohio election law.

Trump, who traveled to the district Saturday for a rally, proclaimed a personal victory on Twitter.

“When I decided to go to Ohio for Troy Balderson, he was down in early voting 64 to 36. That was not good,” Trump wrote late Tuesday night. “After my speech on Saturday night, there was a big turn for the better.”

In tweets the next morning, Trump doubled down on his claim, saying that his support for Republican candidates had been decisive in special elections across the country, and predicting “a giant Red Wave” if he continues to hit the campaign trail for candidates.

“The Republicans have now won 8 out of 9 House Seats, yet if you listen to the Fake News Media you would think we are being clobbered,” Trump said. “Why can’t they play it straight, so unfair to the Republican Party and in particular, your favorite President!”

Trump’s math wasn’t quite on the mark: There have been a total of 10 special House elections since Trump took office, with Republicans winning in 8 of them.

In an appearance on CNN Wednesday morning, O’Connor dismissed Trump’s impact on the race.

“I don’t think he knows what he’s talking about,” O’Connor said of Trump. “Troy Balderson can have all the people he wants fly in from D.C. I don’t think it makes too much of a difference.”

Democrats need a net gain of 23 seats in the House to take control, and there are 72 Republican-held districts with partisan makeups that the Cook Political Report rates as the same as or more liberal than the Ohio district, which includes wealthy suburbs outside Columbus.

“I think Republicans are running out of excuses for why these seats are more competitive than then have been in the past,” said Nathan Gonzales, who handicaps elections at Inside Politics. “The common thread here is Donald Trump is energizing Democrats.”

O’Connor and Balderson will face each other again at the ballot box in November, and both candidates promised Tuesday to continue their campaigns.

“We’re not stopping now,” O’Connor told supporters. “Tomorrow we rest and then we keep fighting through November.”

At his own event, Balderson promised that “for the next three months, I’m going to do everything I can to keep America great again.”

Democratic leaders viewed the result — prompted by the retirement of Rep. Patrick J. Tiberi (R) — as further confirmation that they were poised to take back Congress in the fall.

“This district should have been a slam dunk for the GOP,” said Rep. Ben Ray Luján (D-N.M.), leader of the Democratic midterm effort in the House, in a statement. “The fact that we are still counting ballots is an ominous sign for their prospects in November.”

Under Ohio law, a recount is automatically initiated when the vote margin between the apparent winning candidate and the next leading candidate is less than or equal to 0.5 percent of the total vote. The state has a 10-day window for counting all provisional ballots.

Four other states held elections Tuesday, including several races that also measured Trump’s ability to pick winners in Republican primaries, even when he flouted the wishes of the local party establishment. The president endorsed a longtime ally and adviser, Kansas Secretary of State Kris Kobach, in his race for governor over the Republican incumbent, Gov. Jeff Colyer.

In Michigan, Trump endorsed Attorney General Bill Schuette, who captured the GOP gubernatorial nomination. He also backed John James, a U.S. Military Academy graduate who prevailed over businessman Sandy Pensler for the GOP Senate nomination. That seat is held by Democratic Sen. Debbie Stabenow, who is favored to win reelection.

In recent months, Trump has repeatedly shown he can leverage his high approval among Republicans to swing the party’s primary contests in his favor with endorsements, having successfully chosen the winner in all 11 party contests he has been involved in since June.

That included several contests where his late endorsements, often delivered on Twitter, appeared to be a major factor in the outcome, including the primary victories of Rep. Dan Donovan (R-N.Y.), Rep. Martha Roby (R-Ala.) and Brian Kemp, who won the Georgia GOP nomination for governor last month.

But Trump’s record of choosing the winner in special general elections has been far less impressive, as Democrats and independent voters have demonstrated high enthusiasm for voting against his party’s candidates when they get a chance.

Trump’s divisive political approach has created a squeeze for many Republicans in general elections, campaign consultants say. They find that they have lost independent support because of Trump but still need his involvement in the race to get Republicans to the polls.

Trump endorsed Ed Gillespie when he ran for Virginia governor, Roy Moore in the Senate race in Alabama and Pennsylvania’s Rick Saccone in a House special election. They all lost.

In Tuesday’s House race in Ohio, for a district that includes some of the state’s wealthiest and most well-educated suburbs outside Columbus, Republican groups were forced to once again run a last-minute emergency drill, flooding the state with millions of dollars in advertising and voter mobilization to protect the seat.

Trump attended a rally in the district Saturday with Balderson, following separate visits to the district by his son Donald Trump Jr. and Vice President Pence, as well as a late endorsement from Ohio Gov. John Kasich (R).

Democratic outside groups were outspent by a margin of nearly 4 to 1, though O’Connor proved a much stronger fundraiser than Balderson, a pattern that has repeated itself across the midterm field this year. Democratic donors have flooded campaigns with small donations, and Republicans have been forced to depend on much larger checks from wealthy individuals and outside groups.

A review of television and radio spending in the Ohio race provided by a Democratic consultant showed that between May 8 and Election Day, both sides reached a similar number of people through paid advertising, though Democrats spent about $1 million less, since candidates are offered favorable rates when they buy spots directly through their campaigns.

O’Connor spent nearly $2.4 million on broadcast ads, according to the report, compared with just $571,834 by the Balderson campaign. The Congressional Leadership Fund, a Republican super PAC associated with House Speaker Paul D. Ryan (R-Wis.), spent $2.6 million, according to the report.

Though the race had yet to be called, the CLF issued a statement assuming Balderson had won.

“While we won tonight, this remains a very tough political environment and moving forward, we cannot expect to win tough races when our candidate is being outraised,” CLF executive director Corry Bliss said in a statement. “Any Republican running for Congress getting vastly outraised by an opponent needs to start raising more money.”

Much of that advertising focused on tying O’Connor to House Democratic leader Nancy Pelosi, whom he said he would not support for speaker. One spot also accused O’Connor of wanting to cut $800 million from Medicare because he opposed repealing the Affordable Care Act, which had created cost savings in the program when it initially passed.

In Michigan and Kansas, Democrats elevated two more women as their gubernatorial nominees. Gretchen Whitmer, the former Michigan state Senate leader, defeated several challengers, including Abdul El-Sayed, a candidate backed by Sen. Bernie Sanders (I-Vt.), who was vying to be potentially the country’s first Muslim nominee for governor. In Kansas, state Sen. Laura Kelly captured the nomination.

Democrats will have chosen eight female nominees so far this cycle for gubernatorial races, continuing a pattern that has appeared down ballot as Democratic women continue to notch a historic number of victories in primaries.

In Kansas, Trump backed Kobach, who has waged several losing battles against “voter fraud” in the state, over Colyer, who replaced Sam Brownback after he joined the Trump administration.

Democrats, who have opposed Kobach on the ballot and in court, had a three-way race involving Kelly, former Wichita mayor Carl Brewer and former Environmental Protection Agency official Josh Svaty. Party leaders considered Kelly the strongest candidate, after Greg Orman, a frequent independent candidate, began criticizing her.

Both parties also have combative House primaries, in neighboring districts.

In the 2nd district, engineer Steve Watkins bested six other candidates to win the Republican nomination in the race to succeed retiring Rep. Lynn Jenkins (R). He will face Democrat Paul Davis in the heavily Republican-leaning district.

Attorney Sharice Davids won the Democratic nod in Kansas’s 3rd district, becoming the state’s first gay and Native American congressional nominee. In November, she will face off against Rep. Kevin Yoder (R), who fended off two primary challengers.

In Missouri, Republicans nominated state Attorney General Josh Hawley to run against Sen. Claire McCaskill (D) in what will probably be one of the most competitive races this fall.

Labor unions and Democrats scored a victory as Missouri voters overturned a recently passed “right-to-work” law. The vote nullifies a law that would have prevented unions from collecting mandatory fees from the workers they represent.

Voters in Washington state chose a Democratic nominee to run for the seat of retiring Rep. Dave Reichert (R). Republicans backed Dino Rossi, a state senator who has run twice for governor and once for the U.S. Senate. Kim Schrier, a physician, has been endorsed by Emily’s List and most labor unions, while Jason Rittereiser, a lawyer, has argued that his rural roots would make him more electable in November.

Evan Weese in Columbus, Ohio, and Felicia Sonmez and Dave Weigel in Washington contributed to this report.