Senate Majority Leader Mitch McConnell (R-KY) walks from a vote on Capitol Hill after the senate voted to advance a bill financing the U.S government January 22, 2018 in Washington, DC.

Running on a highly favorable map, Republicans managed not only to stop Democrats from netting two GOP-held seats the minority party needed to win control of the chamber, but also appeared set to gain seats. The Democrats had faced a difficult task of defending 10 seats in states Trump won in 2016, including five he carried easily.

Republicans will hold their Senate majority, giving a critical boost to President Donald Trump and the GOP's agenda, NBC News projects.

In the House, however, Democrats were projected to win a majority, according to NBC News. Divided control of Congress is expected.

Despite his party's expected loss of House control, Trump tweeted late Tuesday touting what he called "tremendous success" in the elections. He added: "Thank you to all!"

Trump tweet

The outcome apparently secures two more years of GOP Senate control, during which Republicans will try to keep up their torrid pace of confirming young, conservative judges for potential decades on federal benches. Republicans could also continue their pursuit of key policy priorities such as the repeal and replacement of the Affordable Care Act and further changes to the U.S. tax code.

Republican Mike Braun is projected to defeat Democratic Sen. Joe Donnelly in Indiana, while Republican Rep. Kevin Cramer is expected to unseat Democratic Sen. Heidi Heitkamp in North Dakota and Republican Josh Hawley is projected to defeat Democratic Sen. Claire McCaskill in Missouri, according to NBC News.

As of early Wednesday morning, the only Democrat set to unseat a Republican incumbent was Rep. Jacky Rosen, who was projected to defeat GOP Sen. Dean Heller.

Meanwhile, the GOP is projected to hold two of its vulnerable Senate seats, according to NBC. Republican Sen. Ted Cruz was set to win re-election, while GOP Rep. Marsha Blackburn was expected to prevail in the Tennessee race to fill retiring GOP Sen. Bob Corker's seat.

Despite Democratic enthusiasm, dynamics in individual states heavily favored the GOP. Republicans further got a boost when the fight over Supreme Court Justice Brett Kavanaugh's confirmation appeared to boost enthusiasm among Republicans.

Many Senate candidates in red-leaning states also followed Trump's lead in the election's final stretch by stoking fears about immigrants.

It sets up another heated battle for Senate control in 2020, a year when Trump will face re-election. In that year, Republicans will have to defend more seats than Democrats.

Watch: Record number of women elected to the House of Representatives