In this Aug. 20, 2020, file photo Democratic presidential candidate former Vice President Joe Biden hugs his wife Jill Biden after his speech during the fourth day of the Democratic National Convention at the Chase Center in Wilmington, Del. Credit: Andrew Harnik / AP

Joe Biden was projected to win the presidency on Friday after absentee ballots in Pennsylvania gave him enough votes to beat President Donald Trump in the battleground state, according to Decision Desk HQ, the Bangor Daily News’ election partner.

It came after a stunning and mixed Tuesday election across the country. Polls overstated the standing of the Democratic nominee and former Vice President in key states, leaving Biden to slog to victory over the Republican president by flipping the midwestern states of Michigan and Wisconsin after a bitter campaign dominated by the coronavirus and its effects on Americans and the economy.

Trump spent Thursday at the White House, working the phones and baselessly sowing doubt about the outcome of the race in an evening news conference. His campaign filed flurries of lawsuits as counting continued in Pennsylvania, Georgia, North Carolina, Arizona and Nevada. Judges in Georgia and Michigan promptly dismissed two lawsuits on Thursday.

Biden, who spent four decades in Washington as former President Barack Obama’s vice president and a longtime Delaware senator, sought to project the appearance of a president on Thursday. He offered reassurance that the counting could be trusted and declared “each ballot must be counted.”

“I ask everyone to stay calm,” he said. “The process is working.”

Biden was projected to win Pennsylvania and the presidency by Decision Desk HQ at 8:50 a.m. Friday. He has won at least 273 Electoral College votes, more than the 270 required to win. He could add more as states finish counting, but Trump has no path to victory in them.

Biden will turn 78 in two weeks, making him the oldest elected president after two failed attempts at the presidency in 1988 and 2008. California Sen. Kamala Harris will be the first woman to serve as vice president as the first Black and Asian American person to hold the seat.

The president-elect has placed himself in the center of the changing Democratic Party from the 1970s through today, even as a recent progressive movement sweeps his party. Biden will take over the response to the coronavirus, which has killed 233,000 Americans as cases continue to rise across the country and caused a deep recession with no end in sight.

He faces an uncertain environment in Washington. Republicans overperformed in Senate elections on Tuesday, including a signature nine-point victory by Susan Collins of Maine in a key race after trailing in polls all year. Unless Democrats oust two incumbents in two blockbuster Georgia runoffs scheduled for Jan. 5, Republicans will keep control of the Senate.

They would then be able to block more aggressive pieces of Biden’s agenda, including a public-option health care plan like one extracted from the Affordable Care Act to mollify moderate Democrats during the Obama administration before it passed in 2010. Republicans could also hamper Biden by refusing to seat Cabinet picks they see as too liberal.

With millions of ballots yet to be tabulated, Biden already had received more than 72 million votes, the most in history. It could take several more days for the count to conclude. Trump’s legal challenges faced long odds. He would have to win suits in multiple states to stop counts.

While the president has insisted that ballot counting stop, it was unclear exactly what that included. He also was benefiting from the continued counting of votes in Arizona early Thursday after the Associated Press and Fox News called the state for Biden a day earlier but Decision Desk HQ and other news organizations declined to join them.

Ballots being tallied as of Friday largely were received by Election Day. Roughly 20 states allow ballots to be counted if postmarked by then but received up to nine days after. Some states loosened those laws as a result of the pandemic, but others routinely allow this.

Trump has fixated on Pennsylvania, where the Supreme Court refused to toss a three-day extension. Biden attorney Bob Bauer said the suits were meritless and were made “to create an opportunity for them to message falsely about what’s taking place in the electoral process.”

Biden won Maine on Tuesday as every Democratic candidate has in eight elections going back to 1992, taking three of the state’s four Electoral College votes as Trump repeated his 2016 victory in Maine’s 2nd Congressional District. The 30-percentage-point gap between the districts was six points bigger than it was in 2016, illustrating the political and cultural “two Maines” phenomenon.

The Democrat romped in southern Maine and along the coast while faring badly in more rural and interior sections. But he overperformed 2016 nominee Hillary Clinton in the 2nd District behind increased margins in service centers in the more conservative population half.

At the polls in Republican-leaning Brewer on Tuesday, Briana Armstrong, a 38-year-old production control manager, said she split her ticket for Biden and Collins.

“I think we need a calming presence that will lead the country in a more proactive and collaborative way,” she said of the president-elect.

This story was written by BDN writer Michael Shepherd and Associated Press writers Jonathan Lemire, Zeke Miller and Will Weissert. BDN writer Emily Burnham and AP writers Jill Colvin and Alexandra Jaffe contributed to this report.