Washington CNN  — 

CNN projects that Republicans will keep control of the Senate, a result that was not unexpected but still never assured in this unpredictable political environment until voters had their say. The outcome represents a significant victory for the GOP and President Donald Trump.

Capitol Hill will now have divided party control after Democrats won back the House of Representatives from Republicans in the 2018 midterms, according to CNN’s projection. That could lead to more legislative gridlock unless the two parties are able to find common ground.

Despite a seemingly energized grassroots electorate, the Democratic Party had been viewed as a long shot to take back control of the Senate where Republicans currently hold a narrow majority of 51 seats to 49 seats for Democrats.

Senate Majority Leader Mitch McConnell and Trump spoke by phone on Tuesday night, according to an aide, who characterized it as “a great conversation” in which McConnell thanked the President for all of his help in the Senate races.

Democrats faced a daunting Senate map in the 2018 midterms and have been forced to defend 10 seats in states that Trump won in the 2016 presidential election, including North Dakota, Montana, West Virginia, Indiana and Missouri. Republicans succeeded in ousting some of those Democrats on Tuesday night, including Sen. Heidi Heitkamp of North Dakota and Sen. Joe Donnelly of Indiana, according to CNN projections. Republicans also fended off challenges from Democrats in the Texas and Tennessee races.

Maintaining control of the Senate paves the way for Republicans to continue advancing the President’s agenda in the upper chamber.

It allows McConnell to push ahead with the ongoing GOP effort to re-shape the federal courts by aggressively confirming conservative judges, a key priority for both the Majority Leader and the President. It also means Senate Republicans can continue to confirm new appointments that may arise for members of the President’s Cabinet. A simple majority is all that’s needed in the Senate to confirm judicial nominees – Supreme Court and lower court picks – and executive branch appointments.

A fight over funding for the President’s signature campaign trail promise of a wall along the US-Mexico border looms large when lawmakers return to Washington after the midterms and along with it, the threat of a partial government shutdown.

The outcome of the midterms marks the culmination of a bitter partisan battle for control of Congress and set the stage for the 2020 elections, where an expansive field of Democratic presidential candidates is expected to challenge Trump after his first term in office. Some high profile senators are expected to be among that growing pool of candidates in the Democratic presidential primary.

The closing days of the midterm campaign have played out with split screen images of Democrats and Republicans emphasizing different messages to the voters they hope will show up to the polls on Tuesday.

Trump has framed the elections as a choice between law and order maintained by Republicans and an out-of-control Democratic mob, while focusing heavily on hardline immigration campaign promises, including a legally dubious pledge to end birthright citizenship for the children of undocumented immigrants born in the US.

In contrast, Democrats maintained a nearly unwavering focus on health care in their closing message to voters. Democratic congressional leaders and candidates vowed on the campaign trail that their party will protect Americans with pre-existing conditions, while warning that Republicans will not.

The final weeks of the campaign season were upended when, in a shocking development, authorities intercepted potential explosive devices targeting top Democratic Party leaders, including former President Barack Obama and former Democratic presidential nominee Hillary Clinton. Just days later, tragedy gripped the nation after 11 people were killed in a shooting at a Pittsburgh synagogue.

The White House and congressional leaders condemned the incidents, but the events have sparked questions and recriminations over whether heated political rhetoric contributed to the violence.

Trump defiantly rejected the idea that his own rhetoric contributed to the incidents and lamented the week before Election Day that the attacks slowed Republican momentum.

“We did have two maniacs stop a momentum that was incredible, because for seven days nobody talked about the elections,” the President said at a Missouri rally last week. “It stopped a tremendous momentum.”

This story has been updated.

CNN’s Ted Barrett, Phil Mattingly, Jeremy Herb and Manu Raju contributed to this report.