In a year when the GOP was almost entirely on defense, the party's incumbents -- many outspent and hobbled by struggling campaigns -- managed to survive a political landscape that long appeared all but certain to cost them the Senate.
Democrats believed they had the perfect mix: Near-locks in blue Illinois and Wisconsin. Top-grade recruits in red states Indiana and Missouri to get them close. And Donald Trump would drag down Republican incumbents in the battlegrounds of Pennsylvania, New Hampshire and North Carolina.
Then, on Tuesday night, everything went wrong for them.
The biggest surprise is that Trump was no drag on the GOP ticket at all -- and might have even helped carry the party.
Trump's margin of victory matched or exceeded those of Todd Young in Indiana and Sen. Richard Burr in North Carolina. Wisconsin Sen. Ron Johnson, who embraced Trump despite expectations the GOP nominee lose his historically Democratic-leaning state, surged late in the race and benefited from Trump's stunning performance there. Incumbents Roy Blunt in Missouri and Pat Toomey won as well, CNN projects.
As of 3 a.m. ET, Republicans held 51 seats to 47 for the Democrats.
The Democrats' lone bright spots were knocking off Illinois Republican Sen. Mark Kirk and holding retiring Senate Minority Leader Harry Reid's seat in Nevada with a victory by Catherine Cortez Masto. There is still a chance in New Hampshire, where GOP Sen. Kelly Ayotte and Democrat Maggie Hassan were neck-and-neck at votes were still being counted.
But there's nothing that will lessen the sting for Democrats.
The Republicans easily held the House, and on a night party officials were confident they'd tip the balance of power in the Senate, Republicans not only remain the majority party -- but appear to head into the 2018 midterms with a map so favorable that a filibuster-proof, 60-seat supermajority is within reach.
The magnitude of the GOP's down-ballot victories was stunning. Its incumbents held seats most Republicans began the 2016 election cycle assuming were lost in some states and overcame weak campaigns in others.
In Florida, Sen. Marco Rubio -- whose late decision to seek re-election after his failed presidential bid was a boon to the GOP's chances of keeping the Senate -- will best Democratic Rep. Patrick Murphy, CNN projects. Republican Sen. Rob Portman will also win re-election in Ohio, CNN projects. He ran what's likely the best Republican campaign of the cycle -- turning what was expected to be a close race with Democratic former Gov. Ted Strickland into a likely blowout.
Indiana delivered major a blow to Democrats' hopes. Former governor and senator Evan Bayh's late entry was expected to turn the state into a guaranteed pickup -- but scrutiny over his residency and lobbying work catapulted Republican Rep. Todd Young to victory, CNN projects.
Democrats picked off one of the five seats they need when Tammy Duckworth defeated Republican Sen. Mark Kirk in Illinois. That race was always a challenge for Kirk, who won Illinois in the 2010 Tea Party wave in the mid-term elections.
Control of the Senate will be key to the early successes of a Trump administration. In theory, controlling Congress and the White House will let the GOP swiftly pass legislation that reverses many of Obama's policies.
Republicans holding their own
Republicans faced a daunting task at the outset of the 2016 election cycle: They held 24 of the 34 seats on the ballot -- meaning many more to defend.
But strong GOP candidates have helped the party pull some contests in presidential swing states off the board such as Florida and Ohio.
In Florida, Rubio's loss in the presidential primary turned out to be the GOP's gain, as he held on to that seat.
Two other former GOP presidential candidates also won their Senate re-election bids, CNN projects. Sen. Rand Paul won in Kentucky, as did 2008 nominee John McCain in Arizona.
In Georgia, Sen. Johnny Isakson was struggling earlier in the year, but he will defeat Democratic challenger Jim Barksdale, CNN projects.
Two more Republicans who were expected to be safe -- Missouri Sen. Roy Blunt and North Carolina Sen. Richard Burr -- found themselves in closer races than expected.
In North Carolina, Burr's late fundraising start -- combined with the Clinton campaign's focus there -- allowed Democrat Ross to turn the state into a toss-up, but he won impressively.
And in Missouri, Secretary of State Jason Kander has run one of the strongest Democratic campaigns -- punctuated by a TV spot that featured the military veteran rebutting attack ads from the National Rifle Association by assembling an AR-15 rifle while blindfolded. But it doesn't appear to be enough to defeat Blunt.
Clinton's recent troubles, including the late focus on her email server, may have hurt Democrats down ballot
House Democrats remain frustrated with FBI Director James Comey, who made a revelation 11 days before the election that the bureau was once again looking into emails potentially tied to its investigation of Clinton. Democrats believe his announcement provided down-ballot Republicans an opportunity to shift topics and attack Clinton, rather than defend Trump.
Minority Leader Nancy Pelosi said Tuesday that Comey "became the leading political operative in the country -- wittingly or unwittingly."
Pelosi blamed Comey for costing Democrats a shot at winning Republican seats across the country, saying he created "more of an obstacle that we hope to overcome" but adding, "it's difficult."