(Reuters) - A Republican clung to a narrow lead in a hotly contested U.S. House of Representatives race in Ohio late on Tuesday, holding off a strong challenge in the reliably Republican district after a late show of support from President Donald Trump.

Republican Troy Balderson led Democrat Danny O’Connor by about 1,700 votes with all precincts reporting, although the Ohio secretary of state’s office said a final result would be delayed until more than 8,000 provisional and absentee ballots were counted.

The close race in the Ohio special election became a referendum on Trump’s leadership and a last chance to gauge Democratic strength ahead of November’s midterm elections.

The narrow margin will be little comfort for Republicans anxious about the prospect of a Democratic wave heading into the Nov. 6 elections, and it is certain to encourage Democrats who performed dramatically better than expected in a district Republicans have represented since the early 1980s.

The central Ohio race was the marquee contest on a day when four other states held nominating contests, including a battle for governor in Michigan in which a mainstream candidate beat a progressive and a high-profile conservative challenge to the incumbent Republican governor in Kansas.

The Ohio contest drew an avalanche of national attention in recent weeks as polls showed it tightening, with Republicans and their allies outspending Democratic groups by more than 4 to 1 and running ads linking O’Connor to liberal House Democratic leader Nancy Pelosi.

O’Connor, a local county official, tried to project a moderate image, saying he would support new Democratic leadership in Congress and work with Republicans but also criticizing the Trump tax cut.

Slideshow ( 17 images )

Trump took credit for the apparent Republican victory, saying on Twitter that Balderson’s campaign made “a big turn for the better” after he campaigned for him in the district on Saturday night.

Balderson told supporters in Ohio: “I’d like to thank President Trump.”

Other Republicans had also rushed to Balderson’s aid. Ohio Governor John Kasich, a Trump critic, endorsed Balderson and Vice President Mike Pence visited.

‘NOT STOPPING’

Trump won the district by 11 percentage points in the White House race in 2016 and Republican Pat Tiberi won re-election to the House by a whopping 37 percentage points.

However, Tiberi resigned before finishing his term, forcing the special election to replace him. O’Connor and Balderson will face off again in November to serve a full two-year term.

Slideshow ( 17 images )

Under Ohio law, the remaining absentee and provisional ballots cannot be counted for 11 days, the secretary of state’s office said. Once they are tallied, an automatic recount would be triggered if the margin of results is within 0.5 percent.

O’Connor refused to concede on Tuesday night and urged supporters on Twitter to make donations for what “could be a long and expensive recount.”

“We’re not stopping now. Tomorrow we rest and then we keep fighting through to November,” O’Connor told supporters at a post-election party.

The Ohio district includes many of the suburban women and college-educated, affluent residents that polls show have been the sort of voters turned off by Trump’s chaotic first 19 months in office.

Democrats need to pick up 23 seats in the House and two seats in the Senate to win majorities in those chambers and put the brakes on Trump’s agenda. All 435 House seats, 35 of 100 Senate seats and 36 of 50 governors’ offices are up for grabs in November.

Michigan, Missouri, Kansas and Washington held primaries on Tuesday, setting the stage for a number of competitive congressional and governor’s races in November.

The Democratic race for governor in Michigan tested the electoral power of the party’s progressive wing. However, former Detroit health director Abdul El-Sayed lost his bid to become the country’s first Muslim governor to a more moderate Democrat, former state Senate leader Gretchen Whitmer.

Whitmer will face Republican Bill Schuette, who was endorsed by Trump, in November.

In Kansas, Kris Kobach, a conservative leader in the movement to restrict illegal immigration and pass more restrictive voting laws, narrowly led Governor Jeff Colyer with about 84 percent of the votes counted for the Republican gubernatorial nomination. However, most of the votes in Johnson County, the state’s most populous county, had yet to be counted, according to the Kansas elections website.

Trump endorsed Kobach, Kansas’ secretary of state, on Monday. Kobach was an immigration adviser to Trump’s campaign in 2016 and vice chairman of Trump’s commission to investigate voting fraud before the panel collapsed.

In Missouri, voters overwhelmingly decided to overturn a right-to-work law passed by the legislature that targeted union organizing.

Bob McCulloch, the incumbent prosecutor in St. Louis county who was criticized for his conduct following the 2014 shooting of Michael Brown in Ferguson that sparked the “Black Lives Matter” movement, also lost a primary race to Wesley Bell, a Ferguson city council member who has vowed criminal justice reform.