Republicans were edging closer to securing a majority in the United States House of Representatives early Thursday, while control of the Senate remained in doubt, two days after Democrats thwarted a Republican “red wave” in midterm elections.

Republicans had won at least 210 House seats, according to Edison Research, falling eight seats short of the 218 needed to wrest control of the House from Democrats and effectively halt President Joe Biden’s legislative agenda.

While Republicans remain the favorites, there are 33 House races that have yet to be decided, including 21 of the 53 most competitive races, according to a Reuters analysis of the leading nonpartisan forecasters, ensuring that the final outcome will not be known for some time.

The Senate’s fate was far less certain. Either party could seize power by winning too-close-to-call races in Nevada and Arizona, where officials are counting thousands of uncounted ballots.

In the event of a split, the Senate majority would be decided in a runoff election in Georgia for the second time in two years. Both Democratic incumbent Raphael Warnock and Republican challenger Herschel Walker failed to reach 50% on Tuesday, forcing them to face off on December 6.

Even a sliver of a House majority would allow Republicans to shape the rest of Biden’s term, blocking abortion rights and launching investigations into his administration and family.

On Wednesday, Biden acknowledged that reality, saying he was willing to work with Republicans. According to a White House official, Biden spoke by phone with Republican House leader Kevin McCarthy, who announced earlier in the day that if Republicans control the House, he will run for speaker.

“I believe the American people have made it clear that they expect Republicans to be willing to work with me as well,” Biden said at a White House press conference.

If McCarthy becomes the next House Speaker, he may find it difficult to unify his fractious caucus, which includes a hard-right wing that is unwilling to compromise.

Republicans are expected to demand spending cuts in exchange for raising the nation’s borrowing limit next year, causing financial markets to tremble.

Meanwhile, Republican control of the Senate would give them the ability to block Biden’s nominees for judicial and administrative positions.

Historically, the ruling party suffers heavy losses in a president’s first midterm election, and Biden has struggled with low approval ratings. However, Democrats were able to avoid the landslide defeat that Republicans had predicted.

The results on Tuesday suggested that voters were punishing Biden for the highest inflation in 40 years, while also criticizing Republican efforts to ban abortion and casting doubt on the nation’s voting system.

At a time when hundreds of Republican candidates embraced Trump’s false claims that the 2020 presidential election was stolen, Biden framed the election as a test of US democracy.

On Tuesday, a number of election deniers were victorious, but many candidates for positions overseeing state elections were defeated.

“I think it was a good day for democracy,” Biden said.

Trump’s active role in recruiting Republican candidates yielded mixed results.

He won in Ohio, where J.D. Vance, author of “Hillbilly Elegy,” won a Senate seat to keep it in Republican hands. However, several other Trump-backed candidates were defeated, including retired celebrity surgeon Mehmet Oz, who was defeated in a key Senate race in Pennsylvania by Democrat John Fetterman.

Meanwhile, Republican Florida Governor Ron DeSantis, who could run against Trump in 2024, was re-elected by nearly 20 points, raising his national profile.