The Democrats were on track to gain House control but the Republicans held their Senate majority as voters rendered a mixed verdict in the first nationwide election of Donald Trump’s turbulent presidency.
The Democrats picked up the 23 seats they would need to take control of the House of Representatives from the Republicans, but were still short of the 218 total to wrest control with more races still undecided.
The results allowed both parties to claim partial victory, and highlighted an extraordinary realignment of US voters by race, sex and education.
The Republicans maintained their strength in conservative, rural states, while Democrats made inroads across America’s suburbs.
Women were assured of 85 seats in the House, more than ever before.
With control of Congress, statehouses and the president’s agenda at stake, some of the nation’s top elections were too close to call.
Yet Democrats’ dreams of the Senate majority as part of a “blue wave” were shattered after losses in many of the top Senate battlegrounds: Indiana, Missouri, Tennessee, North Dakota and Texas.
They also suffered a stinging loss in Florida, where Trump-backed Republican Ron DeSantis ended Democrat Andrew Gillum’s bid to become the state’s first African-American governor.
“I want to encourage you to stick to the fight,” said Mr Gillum, who was thought to be a rising star with national ambitions.
In the broader fight for control in the Trump era, the political and practical stakes on Tuesday were sky high.
Democrats could derail Trump’s legislative agenda for the next two years should they win control of the House. And they would claim subpoena power to investigate Mr Trump’s personal and professional shortcomings.
Some Democrats have already vowed to force the release of his tax returns. Others have pledged to pursue impeachment, although removal from office is unlikely so long as the Republicans control the Senate.
The road to a House majority ran through two dozen suburban districts Hillary Clinton won in 2016. Democrats flipped seats in suburban districts outside Washington, Philadelphia, Miami, Chicago and Denver.
The results were more mixed deeper into Trump country.
In Kansas, Democrat Sharice Davids beat a Republican incumbent to become the first Native American and gay woman elected to the House.
But in Kentucky, one of the top Democratic recruits, retired Marine fighter pilot Amy McGrath lost her bid to oust Andy Barr.
Mr Trump sought to take credit for retaining the Republicans’ Senate majority, even as the party’s foothold in the more competitive House battlefield appeared to be slipping.
“Tremendous success tonight. Thank you to all!” he tweeted.
History was working against the president in the Senate: 2002 was the only midterm election in the past three decades when the party holding the White House gained Senate seats.
Yet Mr Trump’s party will maintain Senate control for the next two years, at least.
In Texas, Ted Cruz staved off a tough challenge from Democrat Beto O’Rourke, whose record-smashing fundraising and celebrity have set off buzz he could be a credible 2020 White House contender.
In Indiana, Trump-backed businessman Mike Braun defeated Democratic incumbent Joe Donnelly. In Missouri, Josh Hawley knocked off Democratic Senator Claire McCaskill. And in Tennessee, Congresswoman Marsha Blackburn defeated former Governor Phil Bredesen, a top Democratic recruit.
In the lead-up to the election, Republicans privately expressed confidence in their narrow Senate majority but feared the House could slip away. The party’s grip on high-profile governorships in Georgia and Wisconsin were at risk as well.
“Tomorrow will be a new day in America,” said House Minority Leader Nancy Pelosi, who is in line to become the next House speaker should the Democrats take the majority.