WASHINGTON — Democrats were optimistic they would reclaim the House majority and Republicans remained cautiously hopeful about maintaining control of the U.S. Senate on Monday as candidates made final pleas to voters, neither side fully trusting their political barometers in the first national referendum on the volatile Trump presidency.

The most expensive midterm in history, one that in many states already has prompted turnout at nearly presidential election levels, will test whether Democrats energized by animosity toward the president can reclaim power and hobble him or whether Donald Trump’s hard-line policies and harsh rhetoric will be reaffirmed by America’s voters.

With heated campaigns concluding across the country – 35 Senate seats, all 435 House seats, 36 governor’s races, and hundreds of state legislative seats – the results could provide far-reaching verdicts for the future of both parties.

But dozens of key races across the country were toss-ups or close to it. And few analysts were willing to definitively predict the outcome, pointing to Democrat Hillary Clinton’s surprise loss in 2016 and the equally stunning losses by Republicans in 2017 elections.

“There’s not the certainty that there normally is,” said Dave Carney, a longtime Republican consultant. “No one knows what the Trump effect is. What the negativity and the yelling and screaming online are going to do.”

Trump, during a three-state blitz to try to support candidates in Ohio, Missouri, and Indiana, concluded the campaign the way he has since entering politics, painting an ominous picture of what the country could become if Democrats regain control of the House or Senate. He has talked about an “invasion” of migrants slowing coming toward the border with Mexico, deemed several black candidates “unqualified,” and on Monday began warning of the potential for voter fraud.

“Tuesday is your chance to send a message to the Democrat mob and to everyone who has made it their mission to denigrate our movement and divide our great nation,” he told supporters during a rally in Cleveland.

“You know the midterm elections used to be, like, boring, didn’t they?” he added. “Do you even remember what they were? People say midterms, they say, ‘What is that, what is it,’ right? Now it’s like the hottest thing.”

But in one sign of the conflict he has injected into the closing weeks of the campaign, nearly every news platform – including CNN, Fox News, Fox Business Network, NBC News and Facebook – said Monday that they would not air Trump’s final campaign ad, calling it offensive. The 30-second ad depicts Central Americans marching in the streets and attempting to push through a gate, while also highlighting the case of an undocumented immigrant who killed two sheriff’s deputies in 2014.

Trump defended the ad, which blamed Democrats for the killings even though the immigrant had been released during a Republican administration.

“They certainly are effective, based on the numbers that we’re seeing,” Trump told reporters when asked about the controversy.

“A lot of things are offensive,” he added. “Your questions are offensive.”

Democrats also cast the impact of the election as existential as they pleaded with voters to deliver a resounding rejection to Trump and his brash brand of politics.

“The character of this country is on the ballot, who we are is on the ballot,” former President Barack Obama said in Fairfax, Virginia. “What kind of politics we expect is on the ballot, how we conduct ourselves is public life is on the ballot. How we treat other people is on the ballot.”

Both sides were bracing for a long night Tuesday.

Democrats have been in a strong position to win the 23 seats needed to reclaim the House majority, largely because many of the competitive races are being fought in suburban districts filled with women and college-educated voters who Trump once struggled with, and now in many cases repels. In dozens of those districts, Republican incumbents retired in the face of widespread protests against them after Trump’s election.

A Washington Post-ABC News poll released Sunday showed that 50 percent of registered voters prefer Democratic House candidates, compared with 43 percent for Republicans.

Democrats also have history on their side. The president’s party almost always loses seats in the first election after he is sworn into office. Republicans picked up 54 seats in 1994 and 63 seats in 2010. This year’s election is projected to be closer to the 31 seats Democrats picked up in 2006.

“If Democrats win the House, the irony will be that the Republicans who lose are the likeliest to be critics of Trump,” said David Wasserman, the House editor of the nonpartisan Cook Political Report. “Trump could argue that these Republicans lost because they weren’t sufficiently supportive of him, when in fact he’s the leading reason why they were in danger.”

Trump is saddled with one of the worst approval ratings in modern presidential history, with 40 percent of Americans approving of the job that he’s doing, according to the Post-ABC poll.

The Senate map is far more forgiving for Republicans; 10 Democratic incumbents are running in states that Trump won. Yet fresh polls Monday prompted Republican concern that they were losing some momentum in tight races.

Democrats would need to gain two seats to retake the Senate majority. Several seats that they currently hold – including ones in Indiana, Missouri, Montana, and Florida – still appear tight. Operatives in both parties expect Sen. Heidi Heitkamp, D-N.D., to lose, which would mean Democrats would need to hold the other Democratic seats and pick up three of the four seats available in Nevada, Texas, Tennessee and Arizona.

Those races are all considered toss-ups, although Democrats seem better positioned in Nevada and Arizona.

Democrats also hoped to turn the tide in governor’s races; Republicans have made substantial gains over the past decade and now control two-thirds of those offices. Those seats – with neck-and-neck races in key states such as Florida, Ohio, and Wisconsin – are crucial ahead of the next redistricting after the 2020 census.

Republicans in many parts of the country feared that the president’s closing argument – centered on the migrant caravan that remains hundreds of miles away, the ordering of more than 7,000 troops to the border, and a proposal to revoke birthright citizenship – has struck the wrong note, damaging the GOP’s odds.

“I wish it was 100 percent about the economic growth numbers and wage increases and jobs. But they’re going with immigration and another approach,” said Scott Reed, the chief political strategist at the U.S. Chamber of Commerce. “The economy’s doing well, and everybody’s brother-in-law has a job. That’s what I think is going to drive turnout more than stories about barbed wire.”

Around the country, voters demonstrated rapt interest in Tuesday’s election. All told, more than 35 million votes have already been cast in early balloting, which is up 66 percent over the 2014 midterms.

As always, it was impossible to predict a partisan advantage from the early numbers; likewise, it won’t be known until the close of the polls Tuesday night whether the high numbers were simply an indication that regular voters were taking advantage of the ability to vote early rather than on Election Day.

In Florida, nearly 40 percent of the electorate has already cast ballots, with Democrats and Republicans voting in about the same numbers. In Nevada, too, about 40 percent have cast ballots, compared with about 25 percent during the 2014 midterm election.

When the 12-day early-voting period ended Friday in El Paso, some 139,000 residents had cast ballots – more than three times the 2014 early-voting turnout. The city, home to Democratic Senate candidate Beto O’Rourke, has historically had among the lowest turnout rates of major U.S. cities but is now on track to at least double its total 2014 turnout of 82,000 votes.

In Minnesota, the secretary of state said that more than 539,000 ballots had been accepted, an increase of 129 percent over 2014.

Outside an early-voting center at a fire station in Eagan, Minnesota, the parking lot was full, with cars lining the street. Long lines were visible all weekend as a steady flow of people cast ballots in one of the competitive House races, where Democrats were hoping to unseat Rep. Jason Lewis, the incumbent Republican.

Jeff Schuette, a 54-year-old stockbroker, saw this year as especially important in helping Trump hold the House majority.

“Am I pleasantly surprised? Mostly yes,” he said. “We seem to be going places we haven’t gone before. He does seem to be moving the needle . . . and moving the country into a freedom direction.”

Joe Panzarella, a 42-year-old marketing event manager, could hardly disagree more. Panzarella considers himself a moderate, but he saw voting for Democrats this year as a vital check against Trump. He worries that the president’s inflammatory rhetoric is “getting out of hand” and inciting violence.

“No one’s controlling him,” he said. “He needs to be stopped.”