Republicans are closing in on a narrow majority in the US House of Representatives while control of the Senate hinged on a series of tight races in a midterm election that defied expectations of sweeping conservative victories driven by frustration over inflation and President Joe Biden’s leadership.
Either party could secure a Senate majority with wins in both Nevada and Arizona – where the races were too early to call.
But there was a strong possibility that, for the second time in two years, the Senate majority could come down to a run-off in Georgia next month, with Democratic Senator Raphael Warnock and Herschel Walker failing to earn enough votes to win outright.
In the House, Democrats kept seats in districts from Virginia to Kansas to Rhode Island, while many in states such as New York and California had not been called.
In a particularly symbolic victory, the Republicans toppled House Democratic campaign chief Sean Patrick Maloney of New York.
Control of Congress will be a key factor in determining the future of Mr Biden’s agenda and serve as a referendum on his administration as the nation reels from record-high inflation and concerns over the direction of the country.
A Republican House majority would be likely to trigger a spate of investigations into Mr Biden and his family, while a Republican Senate takeover would hobble the president’s ability to make judicial appointments.
Democrats, though, saw candidates who prioritised protecting abortion rights after this summer’s Supreme Court decision overturning the landmark Roe v Wade court decision, perform well.
The party won governors’ races, winning in Wisconsin, Michigan and Pennsylvania – battlegrounds critical to Mr Biden’s 2020 win over Donald Trump.
But Republicans held on to governors’ mansions in Florida, Texas and Georgia, another battleground state Mr Biden narrowly won two years ago.
Though neither party had yet secured a majority in either congressional chamber, the midterms did not feature a strong Republican surge, which was uplifting for Democrats who had braced for sweeping losses – and raised questions about how big the Republicans could hope their possible majority might be.
“If we fall a little short, we’re going to know that we gave it our all and we beat the spread.”
Democrats had faced historic headwinds.
The party in power almost always suffers losses in the US president’s first midterm elections, but Democrats bet that anger from the Supreme Court’s decision to gut abortion rights might energise their voters to buck historical trends.
In Pennsylvania, Democrats won the governorship and Senate in the key battleground state.
Lt Gov John Fetterman, who suffered a stroke five months ago, flipped a Republican-controlled Senate seat, topping Trump-endorsed Republican Dr Mehmet Oz.
In the governor’s race, Democratic attorney general Josh Shapiro beat Republican Doug Mastriano, an election denier who some feared would not certify a Democratic presidential win in the state in 2024.
In 2021, Mr Warnock used a run-off to win his seat as did Democratic Senator Jon Ossoff – which gave Democrats control of the Senate.
Both Mr Warnock and Mr Walker were already fundraising off the race stretching into a second round.
Both Republicans and Democratic incumbents maintained key Senate seats.
In Wisconsin, Republican Senator Ron Johnson prevailed over Democratic Lt Gov Mandela Barnes, while in New Hampshire, Democratic Senator Maggie Hassen beat Don Bolduc, a retired army general who had initially promoted Mr Trump’s lies about the 2020 election but tried to shift away from those views closer to election day.
In top governor’s races, Democrats Tony Evers in Wisconsin, Gretchen Whitmer of Michigan, Laura Kelly of Kansas and Kathy Hochul of New York all won.
So did Republican incumbents including Brian Kemp of Georgia, Texas governor Greg Abbott and Florida governor Ron DeSantis, who is expected to run for president in 2024 and could be a major Republican primary challenger to Mr Trump.
The Republican Party was still hoping to knock off Democrat Tina Kotek in Oregon’s three-way governor’s race.
Half of voters said inflation factored significantly, with groceries, petrol, housing, food and other costs that have shot up in the past year.
Slightly fewer – 44% – said the future of democracy was their primary consideration.
Mr Biden did not entirely shoulder the blame for inflation, with close to half of voters saying the higher-than-usual prices were more because of factors outside of his control.
And despite the president bearing criticism from a pessimistic electorate, some of those voters backed Democratic candidates.
Mr Biden spent the night calling Democrats to congratulate them on their wins and was holding a late Wednesday afternoon news conference at the White House.
Voters in reliably red Kentucky rejected a ballot measure aimed at denying any constitutional protections for abortion.
Voters in the swing state of Michigan voted to amend their state’s constitution to protect abortion rights.
The result mirrored what happened in another red state, Kansas, where voters in August rejected changing that state’s constitution to let legislators tighten restrictions or ban abortions.
Voters in the swing state of Michigan, meanwhile, voted to amend their state’s constitution to protect abortion rights.
VoteCast showed that seven in 10 national voters said overturning the 1973 Roe v Wade decision was an important factor in their midterm decisions.
It also showed the reversal was broadly unpopular.
And roughly six in 10 say they favour a law guaranteeing access to legal abortion nationwide.
There were no widespread problems with ballots or voter intimidation reported around the country, though there were hiccups typical of most election days.
One of those Republican candidates, Derrick Van Orden in Wisconsin – who was outside the Capitol during the deadly riot – won a House seat.
Another, JR Majewski, lost to Ohio Democratic Representative Marcy Kaptur.
Democratic Representatives Abigail Spanberger and Jennifer Wexton held off spirited Republican challengers in Virginia districts the Republicans had hoped to flip.
The 2022 elections are on track to cost a projected 16.7 billion dollars (£14.7 billion) at the state and federal level, making them the most expensive midterms ever, according to the non-partisan campaign finance tracking organisation OpenSecrets.
Mr Trump lifted Republican Senate candidates to victory in Ohio and North Carolina.
JD Vance, the bestselling author of Hillbilly Elegy, defeated 10-term congressman Tim Ryan, while Representative Ted Budd beat Cheri Beasley, the former chief justice of the state Supreme Court.
After summoning reporters and his most loyal supporters to a watch party at his Mar-a-Lago club in Florida on Tuesday, he ended the night without a triumphant speech.
Still, the former president insisted on social media that he had had “A GREAT EVENING”.
Hours later, Palm Beach County issued an evacuation order for an area that included Mr Trump’s club with Tropical Storm Nicole approaching.