Alex Wong / Getty

Updated on November 7 at 11:37 a.m. ET

Republicans may have lost the House on Tuesday night, but they secured a valuable consolation prize: a larger Senate majority.

With help from Donald Trump, the GOP advantage in the upper chamber will grow by at least two seats and by as many as four, giving the party a crucial buffer as it tries to extend a conservative imprint on the federal judiciary over the next two years.

Republicans captured Democratic seats in Missouri, Indiana, and North Dakota, as conservative challengers seized on Trump’s enduring popularity with the party base to easily oust incumbents whose tilt to the center was no match for their state’s GOP lean. Senator Claire McCaskill of Missouri fell to state Attorney General Josh Hawley in her bid for a third term, while Senators Joe Donnelly and Heidi Heitkamp could not repeat their surprising victories from six years ago. The businessman Mike Braun defeated Donnelly in Indiana, while Representative Kevin Cramer ousted Heitkamp in North Dakota. Republicans won a fourth seat in Florida, where the two-term governor, Rick Scott, defeated the three-term incumbent, Senator Bill Nelson, by a narrow margin.

At the same time, the GOP blocked Democratic efforts to make inroads into long-standing Republican strongholds. In Texas and Tennessee, neither the insurgent energy behind Beto O’Rourke nor the middle-of-the-road appeal of former Governor Phil Bredesen could overcome the Republican bent of the electorate. Senator Ted Cruz defeated O’Rourke, the well-funded three-term congressman, while the conservative Representative Marsha Blackburn of Tennessee won election to the seat being vacated by retiring Senator Bob Corker.

The GOP held a 51–49 edge heading into the midterm elections. While Democrats still have a chance to pick up seats in Arizona and Nevada, the three losses in the middle of the country and Nelson’s defeat in Florida ensure Republicans will grow their Senate majority.

The precise size of the majority will likely have a limited impact on legislation. Because Democrats appear to have won back the House, any further efforts to repeal the Affordable Care Act, for example, are doomed. But Republican control of the Senate, however narrow, will allow Trump to make an even deeper mark on the federal judiciary, and potentially on the Supreme Court. Republicans have confirmed dozens of appellate and district-court judges in the past two years, and they have cemented a conservative Supreme Court majority with the elevation of Justices Neil Gorsuch and Brett Kavanaugh.

Democrats scored their own victories in West Virginia, where Senator Joe Manchin defeated the state’s attorney general, Patrick Morrisey; and in New Jersey, where scandal-tarred Senator Bob Menendez held on despite an aggressive and well-funded challenge from the businessman Bob Hugin. The Menendez race became competitive after the longtime Democratic senator was tried on corruption charges and admonished by the Senate Ethics Committee. A federal trial ended in a hung jury.

But Republicans retained crucial seats in Texas and in Tennessee, where Blackburn defeated Bredesen in a race Democrats had higher hopes for earlier in the campaign.

In the Democrats’ lone pick-up of the night, Representative Jacky Rosen defeated first-term GOP Senator Dean Heller in Nevada. Like other Republican candidates, Heller had hitched his fortunes to Trump, but in a state carried by Hillary Clinton, that strategy did not work as well. The Democrats’ hopes for a second victory in a GOP-held seat appeared to dim in Arizona, where Representative Martha McSally was narrowly leading Representative Kyrsten Sinema early Wednesday morning. The race in Montana between Democratic Senator Jon Tester and Republican Matt Rosendale remained too close to call.

In the closing weeks, the races for control of the House and the Senate seemed to cleave in separate directions. The Senate campaign was fought largely on Republican turf, unlike many of the crucial House races playing out in GOP-held districts that swung toward Democrats in 2016. Led by Trump, the GOP tried to press its advantage by hammering Democrats over their treatment of Supreme Court nominee—and now justice—Kavanaugh, and by summoning fears of an immigrant caravan of refugees moving north through Central America toward Mexico and the southern U.S. border. The four Senate Democrats who lost all voted against Kavanaugh, while Manchin, who survived, supported his nomination.

Trump, too, played sharply different roles in the most competitive House and Senate contests. Many House contenders in suburban districts that have turned against Trump wanted nothing to do with the president and touted their willingness to oppose him. But GOP Senate candidates like Hawley in Missouri, Cramer in North Dakota, Braun in Indiana, and Morrisey in West Virginia welcomed him to enormous rallies in the hope that he could drive his loyal supporters to the polls.

And as his party’s fortunes sagged in one chamber and improved in the other, Trump tried to take credit for the GOP’s Senate campaigns while dismissing potential losses in the House as par for the course for a first-term president. “I think we’re going to do well in the House,” he told reporters on Sunday. “But as you know, my primary focus has been on the Senate, and I think we’re doing really well in the Senate.”

On Tuesday night, the president ignored the GOP’s defeat in the House entirely. “Tremendous success tonight,” he tweeted. “Thank you to all!”

Despite the favorable political climate, the path for Democrats to a Senate majority this year was daunting from the beginning. Just one-third of the chamber’s 100 seats open up every two years, and in 2018 Democrats were defending 26 seats while Republicans had to protect only nine. And many of those Democratic incumbents were fighting for reelection in red states that Trump had carried by a wide margin two years ago. In North Dakota, for example, Heitkamp won her first election in 2012 by fewer than 3,000 votes. Two years ago, Trump won the state by a whopping 35 percentage points.

Yet even the prospective loss of a few seats did not match the nightmare scenario Senate Democrats were contemplating at the beginning of Trump’s term, when it seemed possible that a strong year could give Republicans close to a filibuster-proof 60 seats. Several Democrats representing states that Trump won in the Rust Belt and the upper Midwest strengthened their positions long before Election Day. They included Senators Sherrod Brown of Ohio, Tammy Baldwin of Wisconsin, Debbie Stabenow of Michigan, and Bob Casey of Pennsylvania—all of whom prevailed on Tuesday.

In contrast to the Democrats, just a single Senate Republican, Heller of Nevada, was up for reelection in a state Clinton carried in 2016. But the race for control of the chamber became much closer with the surprise retirements of Senators Jeff Flake of Arizona and Corker of Tennessee, two Republicans who had bickered with Trump and grown weary of his bombastic brand of politics. In Arizona, Sinema had been running about even with McSally, while Bredesen had faced longer odds against Blackburn.

Still, no Democratic candidate in 2018 captured the imagination—and adoration—of the party’s liberal base more than O’Rourke, the 46-year-old congressman from El Paso who challenged Cruz in Texas. O’Rourke reached voters in every corner of the state by broadcasting his long weekend drives on Facebook Live, and by Election Day he had raised more than $70 million—easily the most for any candidate in the country who was not contributing substantial sums of his own money to his campaign. The energy behind his campaign made the Senate race the closest Texas has seen in years and undoubtedly helped Democrats down the ballot. But it was not enough to overtake Cruz.

So it was, too, for Democrats more broadly. The party swept in to the House majority on a wave of repudiation of Trump by voters in suburban districts. But Democrats could not puncture the president’s equally energized base in rural America, and by the end of the night, they had slipped further behind Republicans in the Senate than when they had started.

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