Tupungato / Shutterstock / Thanh Do / The Atlantic

Democrats will recapture control of the House of Representatives, and could gain as much as a 20-seat advantage, ending eight years of Republican control and dealing President Donald Trump a stiff rebuke.

With many results in, Democratic candidates either had won or were leading in enough districts to likely win the 23 seats needed to capture the chamber and then some. The question now is how big the Democratic advantage will be when results from all races are in. The results are largely in line with early predictions, though early returns suggested the scale of Democratic victories might be smaller than anticipated, and Democratic analysts such as James Carville declared the hope of a blue wave dead. Yet despite tough losses for Democrats in Senate and gubernatorial races, the House has shaped up about as well as the party could have hoped.

Democratic control of the House will shift the terrain in Washington, providing a genuine counterweight to President Trump for the first time in his presidency, and breaking the unified Republican control of the House, Senate, and White House. While it will be all but impossible for Democrats to actually enact any of their priorities into law, House control provides them a position to conduct strict oversight on the Trump administration.

The Democratic wins have occurred across the country. They have won in districts that Hillary Clinton won in 2016, and they have won in districts Trump won. There have been victories in traditionally Democratic states such as Illinois and Minnesota, but also in more exotic locales for Democrats in the current era, including Kansas and Oklahoma. Pennsylvania and Virginia are emerging as particular bright spots for the party early.

The wins in Virginia showcase the Old Dominion’s emergence as a solid Democratic state. In addition to Tim Kaine’s easy victory in the U.S. Senate race, the first flipped seat of the night to be called had Jennifer Wexton handily defeating Barbara Comstock in Northern Virginia’s Tenth District. Comstock is a longtime Republican soldier and the party poured millions of dollars into the race, but was unable to save the two-term representative. Elaine Luria also beat Scott Taylor in the Eleventh District. Additionally, Abigail Spanberger is poised to beat Dave Brat, the Republican who unseated House Majority Leader Eric Cantor in a 2014 GOP primary.

In Pennsylvania earlier this year, the state supreme court ordered new congressional districts to be drawn, saying that the old maps constituted an unconstitutional partisan gerrymander. The new maps were far more favorable to Democrats, and they have capitalized. Mary Gay Scanlon won in the Fifth District, a substantially new constituency. Also in Pennsylvania, Representative Conor Lamb is expected to defeat Representative Keith Rothfus in a new district that double-bunked the members. Chrissy Houlahan won the Sixth District, vacated by retiring member Ryan Costello. Susan Wild won the Seventh, held by Charlie Dent, who is also retiring. However, the Republican Guy Reschenthaler won the Fourteenth.

In Florida’s Twenty-Seventh District, former Secretary of Health and Human Services Donna Shalala defeated Maria Elvira Salazar. The district had been held by a retiring Republican, and while Shalala was a favorite, her slipping polling made Democrats nervous in the closing days of the race. Debbie Mucarsel-Powell defeated Carlos Curbelo in Florida’s Twenty-Sixth District.

Democrats also won in Illinois, with Sean Casten winning in the Sixth. In New York, Antonio Delgado and Anthony Brindisi won in the Nineteenth and Twenty-Second Districts. And on Staten Island, a GOP stronghold in deep-blue New York City, Max Rose unseated Dan Donovan, a Trump-supported candidate who survived a primary challenge in the Eleventh District this year.

In Colorado’s Sixth, Jason Crow is on track to defeat Mike Coffman, a Trump-skeptical Republican. In Michigan’s Eleventh District, an open seat held by a retiring Republican, Haley Stevens won. In Minnesota’s Third, Erik Paulsen, a veteran Republican, lost to Dean Phillips. Another veteran, Texas’s Pete Sessions, lost to Colin Allred in the Thirty-Second District. Ann Kirkpatrick, a two-time former representative, will return to the chamber a third time, winning a race to replace Martha McSally, who is running for Senate. Mikie Sherrill has won in New Jersey’s Eleventh District, formerly held by the retiring Republican Rodney Frelinghuysen. In Kansas’s Third District, Sharice Davids beat Kevin Yoder. Kendra Horn defeated Steve Russell in Oklahoma’s Fifth.

Democrats also lead in a range of other contested races, though their hopes for a clean sweep through strongly Republican districts were confounded in a series of heartbreaking losses. For example, Amy McGrath failed to unseat Andy Barr in a much-watched Kentucky race. Yet on a night when the Senate gave Democrats bleak results and governors’ races were a mixed bag, House candidates came through for them.

The Republican losses are in line with both historical precedent and most predictions. The president’s party typically loses seats during midterm elections—though Trump had spoken boldly of defeating the pattern—and Democratic voters have shown surprising strength in special elections since 2016. By the eve of voting, the leading analysts all expected a Democratic edge. The question was, and remains, how large it would be.

While every race has its own specific circumstances, there’s no mistaking the major factor in the Democratic win: Donald Trump. The president said he was on the ballot, and voters appear to have agreed, according to exit polls. While Democrats wrestled with how to speak about him on the campaign trail and in ads, his influence is visible in the results. Democrats competed in districts that Trump won handily in 2016, including in the Rust Belt and even in deep-red Texas. Preliminary data show that turnout was exceptionally high among minorities and youth voters compared with recent midterm elections. In some cases, Trump’s personality and style were a factor. In others, his policies, especially his attempts to dismantle the Affordable Care Act, proved a powerful issue for Democratic candidates. Republican turnout was up as well, which helps to explain the muted Democratic results.

During the summer of 2018, Trump was predicting a “red wave,” a retort to predictions of a “blue wave,” though as Election Day approached, he backed off that prediction, telling the Associated Press in October that he would not accept blame if Republicans lost the House, and saying this week that he was concentrating on preserving the GOP edge in the Senate, acknowledging the prospect of losing the House.

The Democratic win calls into question Trump’s strategy of hammering on immigration as a wedge issue in the closing weeks of the campaign. While the issue is catnip to his base, his divisive and dark rhetoric wasn’t effective in rallying Republicans to the polls in numbers great enough to preserve their majority.

The Democratic victory ends a brief period of unified Republican control of government, including the White House, the House, the Senate, and effectively the Supreme Court. The House has been in Republican hands since the 2010 Tea Party wave. As The Washington Post notes, it’s the third time control of the chamber has flipped in the last 12 years, a level of vacillation not seen since the immediate post–World War II period.

Republicans hand over the gavel with a decidedly mixed record. They successfully stymied much of President Barack Obama’s agenda from 2011 on, but they largely failed to further conservative priorities. Federal spending continues to grow; entitlements have not been cut; Obamacare remains in place, though scaled back; and after aiming for a tax-code overhaul, they had to settle for temporary tax cuts. Much of that class of 2010 has left the House or is leaving this year, and the party is also losing its leader. Wisconsin’s Paul Ryan, hailed as one of the party’s brightest young thinkers, was reluctantly thrust into the speakership, but opted to retire this year, apparently tired of being caught between the unpredictable and often outrageous president and a fractious caucus.

It’s likely that the Democratic leader, at least initially, will be a familiar face: former Speaker Nancy Pelosi. Although a growing number of Democrats have chafed against her leadership, and some won election this year promising not to vote for her, she remains the heavy favorite to reclaim the gavel—at least to begin. Pelosi has been eager to reclaim the speakership, after serving in that role from 2007 to 2011, but has said she is likely to be a “transitional” leader, paving the way for a new Democratic speaker in the near future.

With Republicans in control of the Senate and White House, any Democratic policy priorities will be largely symbolic, though tensions between very progressive members and those representing swing districts will test the cohesion of the caucus and the skills of its leaders. Where Democrats are likely to make their biggest impact is in oversight of the White House. The majority means Democratic chairs of committees will have subpoena power, and are likely to deluge the Trump administration with requests for documents and testimony on a range of issues. They could demand to see the president’s tax returns. They could even attempt to impeach him.

For Trump, the frustration will not end there. He’s never enjoyed working with Congress, and has expressed frustration at the slow pace of both chambers. Having the opposition party in control of the House will create further gridlock. If there’s a silver lining for the president, though, it’s that a Democratic House will create a useful foil for him as he runs for reelection in 2020.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.