The Republicans have retained Senate control for two more years, shattering Democrats’ dreams of an anti-Trump wave sweeping them to a majority.
The result was all but assured when Republican Kevin Cramer ousted North Dakota Democratic Senator Heidi Heitkamp and when Republican businessman Mike Braun ousted Senator Joe Donnelly in Indiana.
Meanwhile, Ted Cruz fended off a spirited challenge from Democrat Beto O’Rourke and Republican Senator Marsha Blackburn triumphed in Tennessee.
The Republicans’ gains came even as the results in Nevada and Arizona had yet to be determined.
Donald Trump spoke of a “tremendous success” in a post on Twitter.
Meanwhile, Democrats were gaining ground in the battle for House control, winning half of the seats they needed with dozens of additional competitive contests remaining.
Victories in contested House races across Florida, New York, Virginia, Pennsylvania and Minnesota gave them cause for optimism.
The mixed results unfolded as an anxious nation watched to see whether voters would reward or reject the Republicans in the first nationwide election of Mr Trump’s turbulent presidency.
Tremendous success tonight. Thank you to all!— Donald J. Trump (@realDonaldTrump) November 7, 2018
In the lead-up to the election, Republicans privately expressed confidence in their narrow Senate majority but feared the House could slip away.
The Republicans’ grip on high-profile governorships in Florida, Georgia and Wisconsin were at risk as well.
“Everything we have achieved is at stake,” Mr Trump declared in his final day of campaigning.
Long lines and malfunctioning machines marred the first hours of voting in some precincts, including in Georgia, where some voters reported waiting up to three hours to vote in a hotly contested gubernatorial election.
More than 40 million Americans had already voted, either by mail or in person, breaking early voting records across 37 states, according to analysis.
Nearly 40% of voters cast their ballots to express opposition to the president, according to a national survey of the electorate, while one-in-four said they voted to express support for Mr Trump.
Mr Trump encouraged voters to view the first nationwide election of his presidency as a referendum on his leadership, pointing proudly to the surging economy at recent rallies.
He bet big on a xenophobic closing message, warning of an immigrant “invasion” that promised to spread violent crime and drugs across the nation.
Democrats needed to pick up two dozen seats to seize the House majority and two seats to control the Senate.
All 435 seats in the US House were up for re-election, although fewer than 90 were considered competitive while some 35 Senate seats were in play, as were almost 40 governorships and the balance of power in virtually every state legislature.
The political and practical stakes were sky-high.
Democrats could derail Mr Trump’s legislative agenda for the next two years should they win control of the House.