Republicans held onto their slim Senate majority Wednesday, a stinging blow to Democrats in a night full of them. Democrats had been nearly certain of retaking control but saw their hopes fizzle as endangered GOP incumbents won in Missouri, Pennsylvania, North Carolina and even Democrat-friendly Wisconsin.

GOP-held New Hampshire remained too close to call in the early morning hours Wednesday, but even if Democrats eked out a win there it would not make a difference.

Republicans started the night with a 54-46 majority in the Senate and were on track to end up with at least 52 seats, presuming they win a December runoff in Louisiana, as expected.

The outcome added to a debacle of a night for Democrats, who lost the presidency and faced being consigned to minority status on Capitol Hill for years to come.

Republicans celebrated their wins, already looking ahead to midterms in 2018 when Democrats could see their numbers reduced even further with a group of red-state Senate Democrats on the ballot.

Senate Majority Leader Mitch McConnell of Kentucky, who will serve in that role next year under a President Trump, issued a statement congratulating the president-elect.

"After eight years of the Obama administration, the American people have chosen a new direction for our nation. President-elect Trump has a significant opportunity to bring our nation together," McConnell said. "It is my hope and intent that we succeed in the years ahead by working together with our colleagues across the aisle to strengthen our national and economic security."

As the night wore on, Democratic operatives struggled to explain why their optimistic assessments of retaking Senate control were so mistaken. Some blamed unexpected turnout by certain segments of white voters, or FBI Director James Comey’s bombshell announcement that he was reviewing a new batch of emails connected with Democrat Hillary Clinton.

In Pennsylvania, GOP Sen. Pat Toomey won a narrow victory for his second term over Democratic challenger Katie McGinty. It was a race Democrats expected to win going into the night - and one that many Republicans felt nearly as sure they’d lose.

The story was the same in Wisconsin, where GOP Sen. Ron Johnson, written off for months by his own party, won re-election against former Democratic Sen. Russ Feingold in a rematch.

In Missouri and North Carolina, where entrenched GOP incumbents Roy Blunt and Richard Burr faced unexpectedly strong challenges from Democrats, both prevailed in the end.

Democrats did grab a Republican-held seat in Illinois, where GOP Sen. Mark Kirk lost to Democratic Rep. Tammy Duckworth, a double-amputee Iraq war vet. That stood as the one Democratic pickup as the early morning hours ticked toward Wednesday.

The other bright spot for Democrats was in Nevada, where Minority Leader Harry Reid’s retirement after five terms created a vacancy and the one Democratic-held seat that was closely contested. Reid maneuvered to fill it with his hand-picked successor, Catherine Cortez Masto, Nevada’s former attorney general who spoke often of her family’s immigrant roots in a state with heavy Latino turnout.

Cortez Masto will become the first Latina U.S. senator. She beat Republican Rep. Joe Heck, who struggled with sharing the ticket with Donald Trump, first endorsing and then un-endorsing Trump to the disgust of some GOP voters.

Indeed the Senate races were shadowed every step of the way by the polarizing presidential race between Clinton and Trump. Yet in the end, Trump was apparently not the drag on GOP candidates widely anticipated. Republicans like Johnson who endorsed him and stuck with it won re-election, as did others like Pennsylvania’s Toomey who never backed Trump until the very end. And so did a few like GOP Sen. John McCain of Arizona who un-endorsed Trump after audio emerged of him boasting of groping women.

McCain, at age 80, won his sixth term in quite possibly his final campaign. The 2008 GOP presidential nominee was re-elected without much difficulty despite early predictions of a competitive race, and struck a reflective note ahead of the outcome.

"While as Yogi Berra said, ’I hate to make predictions, especially about the future,’ I’m not sure how many more I have in me," McCain said.

In Indiana, GOP Rep. Todd Young beat former Democratic senator and governor Evan Bayh, who mounted a much-ballyhooed comeback bid, but wilted under scrutiny. And in Florida, GOP Sen. Marco Rubio beat Democratic Rep. Patrick Murphy, giving Rubio a platform from which he could mount another bid for president in 2020.

In New York, Sen. Chuck Schumer, the Democrats’ leader-in-waiting for a new Congress, easily won re-election. But the results elsewhere meant he would be leading a Senate minority when he replaces Reid in the leader’s role.

Even though the GOP’s renewed control of the Senate will be narrow, the advantages of being in the majority are significant. The controlling party holds the committee chairmanships, sets the legislative agenda and runs investigations. First up is likely to be a nominee to fill the vacancy on the Supreme Court.