US President Donald Trump.

Voters across the United States were set to cast ballots Tuesday in midterm elections that will determine control of Congress and measure the strength of Democratic opposition to President Donald Trump.

The highly anticipated midterms come two years after Trump's surprise victory in the last major countrywide election, which saw Republicans not only win the highest office, but also maintain control of the US House of Representatives and Senate.

In 2016, Trump's party also increased the number of Republican governors and Republican-controlled state legislators across the country.

Tuesday's results are expected to show whether there has been a shift toward the Democrats or whether voters will hand Trump and the Republicans an even firmer grip on power.

A key result on Tuesday will be how many of the 435 seats in the House can Democrats "flip" to their side. Twenty-three or more would give them the majority in the chamber, which polls say they are likely to achieve according to an analysis published by Politico.

It counted 216 races that are either solidly Democratic, likely Democratic or at least leaning Democratic. If the analysis proves accurate, the party would need to win only two of 22 races that were considered toss ups on the eve of the election.

Republicans had 197 seats where the vote was leaning or solidly going their way in pre-election polls. Were that be accurate, they would have to sweep nearly all of the 22 races that are too close to call to hold onto their House majority, according to the analysis.

A Democrat-controlled House would be a rebuke to Trump and stop much of his legislative agenda dead in its tracks. But it would also provide him with a scapegoat for the gridlock, while still getting his nominees through the Senate, assuming Republicans maintain power in the upper chamber.

Thirty-five Senate seats are up for grabs, 26 of which are currently held by Democrats. Polls indicate the Republican party is likely to maintain its 51-49 majority and possibly enhance it, but there are still many closely watched contests.

Those too close to call were in Florida, West Virginia, Indiana, Missouri, Montana, Nevada and Arizona. All were stops on Trump's busy campaign schedule in the days leading up to the midterms. Another state, North Dakota, appeared headed to flip to the Republicans, according to analysis by realclearpolitics.com.

Beyond the House and Senate the 36 gubernatorial races could provide some of the best drama on election night. Many of them couldn't be called prior to voting, including four big states that Trump carried in 2016 - Florida, Georgia, Ohio and Wisconsin.

At his rallies, Trump cited the strong US economy, including a low unemployment rate of 3.7 per cent, and healthy gross domestic product growth on target to reach 3 per cent this year.

"Everything we have created and achieved is at stake on election day," he said Monday in Cleveland, Ohio. "A vote for Republicans is a vote to continue our prosperity."

Trump also made his hard stance on immigration a key focus of the campaign, stoking fear over a caravan of migrants traversing Mexico en route to the US-Mexico border and ordering US troops to border regions.

Democrats countered by telling voters to elect their candidates to prevent further cuts to popular healthcare reforms. The message was aimed at getting a high turnout from college-educated women and young voters, two groups that pollsters said could boost Democrats if they turnout in large numbers.

Former president Barack Obama was among the high-profile Democrats who hit the campaign trail on behalf of the party's candidates.

In a rejection of Trump's rhetoric, Obama said voters should see the midterms as a test of the nation's character in light of a politically inspired mail bomb scare and a shooting at a synagogue that killed 11 people.

"The character of this country is on the ballot," Obama said Monday in Virginia. "Who we are is on the ballot."