WASHINGTON (AP) - Democrat Joe Biden defeated President Donald Trump to become the 46th president of the United States on Saturday, positioning himself to lead a nation gripped by a historic pandemic and a confluence of economic and social turmoil.
His victory came after more than three days of uncertainty as election officials sorted through a surge of mail-in votes that delayed processing. Biden crossed the winning threshold of 270 Electoral College votes with a win in Pennsylvania.
Trump refused to concede, threatening further legal action on ballot counting.
Biden, 77, staked his candidacy less on any distinctive political ideology than on galvanizing a broad coalition of voters around the notion that Trump posed an existential threat to American democracy. The strategy proved effective, resulting in pivotal victories in Michigan and Wisconsin as well as Pennsylvania, onetime Democratic bastions that had flipped to Trump in 2016.
Biden, in a statement, declared it was time for the battered nation "to unite and to heal."
"With the campaign over, it's time to put the anger and the harsh rhetoric behind us and come together as a nation," he said. "There's nothing we can't do if we do it together."
Biden was on track to win the national popular vote by more than 4 million, a margin that could grow as ballots continue to be counted.
Trump was not giving up.
Departing from longstanding democratic tradition and signaling a potentially turbulent transfer of power, he issued a combative statement saying his campaign would take unspecified legal actions and he would "not rest until the American People have the honest vote count they deserve and that Democracy demands."
Trump has pointed to delays in processing the vote in some states to allege with no evidence that there was fraud and to argue that his rival was trying to seize power - an extraordinary charge by a sitting president trying to sow doubt about a bedrock democratic process.
Kamala Harris made history as the first Black woman to become vice president, an achievement that comes as the U.S. faces a reckoning on racial justice. The California senator, who is also the first person of South Asian descent elected to the vice presidency, will become the highest-ranking woman ever to serve in government, four years after Trump defeated Hillary Clinton.
Trump is the first incumbent president to lose reelection since Republican George H.W. Bush in 1992.
He was golfing at his Virginia country club when he lost the race. He stayed out for hours, stopping to congratulate a bride as he left, and his motorcade returned to the White House to a cacophony of shouts, taunts and unfriendly hand gestures.
Trump earlier repeated his unsupported allegations of election fraud and illegal voting on Twitter. One of his tweets, quickly flagged as potentially misleading by Twitter, claimed: "I WON THIS ELECTION, BY A LOT!"
In Wilmington, Delaware, near a stage that has stood empty since it was erected to celebrate on Election Night, people cheered and pumped their fists as the news that the presidential race had been called for the state's former senator arrived on their cellphones.
On the nearby water, two men in a kayak yelled to a couple paddling by in the opposite direction, "Joe won! They called it!" as people on the shore whooped and hollered. Harris, in workout gear, was shown on video speaking to Biden on the phone, exuberantly telling the president-elect "We did it!" Biden was expected to take the stage for a drive-in rally after dark.
Across the country, there were parties and prayer. In New York City, spontaneous block parties broke out. People ran out of their buildings, banging on pots. They danced and high-fived with strangers amid honking horns. Among the loudest cheers were those for passing U.S. Postal Service trucks.
People streamed into Black Lives Matter Plaza near the White House, near where Trump had ordered the clearing of protesters in June, waving signs and taking cellphone pictures. In Lansing, Michigan, Trump supporters and Black Lives Matter demonstrators filled the Capitol steps. The lyrics to "Amazing Grace" began to echo through the crowd, and Trump supporters laid their hands on a counter protester, and prayed.
Americans showed deep interest in the presidential race. A record 103 million voted early this year, opting to avoid waiting in long lines at polling locations during a pandemic. With counting continuing in some states, Biden had already received more than 74 million votes, more than any presidential candidate before him.
Trump's refusal to concede has no legal implications. But it could add to the incoming administration's challenge of bringing the country together after a bitter election.
Throughout the campaign, Trump repeatedly refused to commit to a peaceful transfer of power, arguing without evidence that the election could be marred by fraud. The nation has a long history of presidential candidates peacefully accepting the outcome of elections, dating back to 1800, when John Adams conceded to his rival Thomas Jefferson.
It was Biden's native Pennsylvania that put him over the top, the state he invoked throughout the campaign to connect with working class voters. He also won Nevada on Saturday pushing his total to 290 Electoral College votes.
Biden received congratulations from dozens of world leaders, and his former boss, President Barack Obama, saluted him in a statement, declaring the nation was "fortunate that Joe's got what it takes to be President and already carries himself that way."
Republicans on Capitol Hill were giving Trump and his campaign space to consider all their legal options. It was a precarious balance for Trump's allies as they try to be supportive of the president -- and avoid risking further fallout -- but face the reality of the vote count.
On Saturday, Senate Majority Leader Mitch McConnell had not yet made any public statements -- either congratulating Biden or joining Trump's complaints. But retiring GOP Sen. Lamar Alexander of Tennessee, who is close to McConnell, said, "After counting every valid vote and allowing courts to resolve disputes, it is important to respect and promptly accept the result."
More than 236,000 Americans have died during the coronavirus pandemic, nearly 10 million have been infected and millions of jobs have been lost. The final days of the campaign played out against a surge in confirmed cases in nearly every state, including battlegrounds such as Wisconsin that swung to Biden.
The pandemic will soon be Biden's to tame, and he campaigned pledging a big government response, akin to what Franklin D. Roosevelt oversaw with the New Deal during the Depression of the 1930s. But Senate Republicans fought back several Democratic challengers and looked to retain a fragile majority that could serve as a check on such Biden ambition.
The 2020 campaign was a referendum on Trump's handling of the pandemic, which has shuttered schools across the nation, disrupted businesses and raised questions about the feasibility of family gatherings heading into the holidays.
The fast spread of the coronavirus transformed political rallies from standard campaign fare to gatherings that were potential public health emergencies. It also contributed to an unprecedented shift to voting early and by mail and prompted Biden to dramatically scale back his travel and events to comply with restrictions. The president defied calls for caution and ultimately contracted the disease himself.
Trump was saddled throughout the year by negative assessments from the public of his handling of the pandemic. There was another COVID-19 outbreak in the White House this week, which sickened his chief of staff Mark Meadows.
Biden also drew a sharp contrast to Trump through a summer of unrest over the police killings of Black Americans including Breonna Taylor in Kentucky and George Floyd in Minneapolis. Their deaths sparked the largest racial protest movement since the civil rights era. Biden responded by acknowledging the racism that pervades American life, while Trump emphasized his support of police and pivoted to a "law and order" message that resonated with his largely white base.
The third president to be impeached, though acquitted in the Senate, Trump will leave office having left an indelible imprint in a tenure defined by the shattering of White House norms and a day-to-day whirlwind of turnover, partisan divide and Twitter blasts.
Trump's team has filed a smattering of lawsuits in battleground states, some of which were immediately rebuffed by judges. His personal lawyer, Rudy Giuliani, was holding a news conference in Philadelphia threatening more legal action when the race was called.
Biden, born in Scranton, Pennsylvania, and raised in Delaware, was one of the youngest candidates ever elected to the Senate. Before he took office, his wife and daughter were killed, and his two sons badly injured in a 1972 car crash.
Commuting every night on a train from Washington back to Wilmington, Biden fashioned an everyman political persona to go along with powerful Senate positions, including chairman of the Senate Judiciary and Foreign Relations Committees. Some aspects of his record drew critical scrutiny from fellow Democrats, including his support for the 1994 crime bill, his vote for the 2003 Iraq War and his management of the Clarence Thomas' Supreme Court hearings.
Biden's 1988 presidential campaign was done in by plagiarism allegations, and his next bid in 2008 ended quietly. But later that year, he was tapped to be Barack Obama's running mate and he became an influential vice president, steering the administration's outreach to both Capitol Hill and Iraq.
While his reputation was burnished by his time in office and his deep friendship with Obama, Biden stood aside for Clinton and opted not to run in 2016 after his adult son Beau died of brain cancer the year before.
Trump's tenure pushed Biden to make one more run as he declared that "the very soul of the nation is at stake."
Associated Press writers Will Weissert in Wilmington, Delaware and Jill Colvin in Washington contributed to this report.