Updated at 10:57 p.m.

Massachusetts provided one of the few moments of certainty on a historically contentious election night as Democratic Sen. Ed Markey cruised to re-election over Republican challenger and first-time candidate Kevin O’Connor.

In heavily blue Massachusetts, Markey was always a favorite to win re-election to a second full term in the Senate after winning a special election in 2013 and then re-election in 2014. He had previously served in the U.S. House of Representatives for 37 years.

The race was called by the Associated Press shortly after polls closed at 8pm. Former Vice President Joe Biden was also projected to win the state's 11 electoral votes.

In a statement to Twitter, Markey wrote that "voters in Massachusetts have reaffirmed the mandate of our grassroots movement. Together, we are going to fight for bold and systemic change in the United States Senate."

"I will fight every day to make you proud of your vote," Markey said during a livestreamed video statementto social media. He also reiterated his support for Joe Biden and Kamala Harris, predicting a "historic victory."

The big question in this race was whether Markey would survive a Sept. 1 primary challenge from Rep. Joseph Kennedy III, who appeared to be the front-runner in early polls last year. Kennedy won the endorsement of House Speaker Nancy Pelosi, but Markey got the endorsement of Rep. Alexandria Ocasio-Cortez, D-N.Y., and was a leading co-sponsor with her of the Green New Deal, a sweeping proposal for action to fight climate change.

Kennedy and Markey each raised more than $10 million for the race, and Markey ended up winning by a comfortable 55%-45% margin.

That left Markey with only O’Connor to beat — a little known Republican lawyer from Dover who raised less than $1 million for his campaign.

Speaking to supporters in South Boston Tuesday evening, O'Conner said, "we put up a robust fight, I think a great fight. And I think we won the argument on the merits." But, he added, "you learn in competition that sometimes the victory isn't this game, it's the next game."

The two faced off for one debate in early October that largely revolved around who was to blame for the coronavirus pandemic and whether Amy Coney Barrett, President Trump’s pick to fill Ruth Bader Ginsburg’s seat on the Supreme Court, should be confirmed. Markey tried to paint O’Connor as being too aligned with the current occupant of the White House and O’Connor argued that Markey is too far to the left of the mainstream Democratic Party to represent Massachusetts.

In the runup to the election, both Republican and Democratic donors turned their attention elsewhere, spending millions funding Senate campaigns outside the state, a signal of how little doubt there was about the outcome here. Which party will control the Senate come January has been a major focal point of this year's election cycle with several Republican incumbents — from Maine to South Carolina to Iowa to Arizona — vulnerable to well-financed Democratic challengers.