Vice President Pence reopened the Senate on Jan. 6 to continue the count of state electors after a pro-Trump mob stormed the U.S. Capitol earlier in the day. (Video: The Washington Post)

Members of Congress, shaken and angry following a violent assault on the U.S. Capitol by a mob of President Trump’s supporters, put a final stamp on President-elect Joe Biden’s victory early Thursday morning and brought an end to a historically turbulent post-election period.

Republicans had at one point planned to object to the electoral college votes in a series of states won by Biden, but after the storming of the Capitol, several GOP senators changed course, disputing only Arizona and Pennsylvania. Both challenges failed.

Shortly after Congress affirmed Biden’s win, Trump pledged an “an orderly transition.” The statement, tweeted by White House social media director Dan Scavino as Trump remained locked out of his own Twitter account, stops short of conceding or congratulating Biden.

“Even though I totally disagree with the outcome of the election, and the facts bear me out, nevertheless there will be an orderly transition on January 20th,” Trump said, noting that Congress’s action “represents the end of the greatest first term in presidential history.”

In the final moments of the joint session, Senate Chaplain Barry C. Black said a prayer lamenting “the desecration of the United States Capitol building, the shedding of innocent blood, the loss of life and the quagmire of dysfunction that threaten our democracy,” and Vice President Pence gaveled the meeting to a close, as the Democrats present gave only a half-hearted show of applause.

The lawmakers convened Wednesday evening, after hours of delay, in a show of defiance. House Speaker Nancy Pelosi said she had consulted with fellow congressional leaders, the Pentagon, the Justice Department and Vice President Pence before concluding that Congress should move ahead with the ceremony interrupted earlier in the day by rioters provoked to action by Trump at a morning rally.

“Today, a shameful assault was made on our democracy. It was anointed at the highest level of government. It cannot, however, deter us from our responsibility to validate the election of Joe Biden,” wrote Pelosi (D-Calif.).

As lawmakers returned to work following the riot, the tone of the debate turned more somber and impassioned than before the interruption, with a number of Republicans who had planned to slow the proceedings with objections announcing they would stand aside.

“To those who wreaked havoc in our Capitol today, you did not win. Violence never wins. Freedom wins. This is still the people’s house,” Pence said as he formally reopened the Senate.

Senate Majority Leader Mitch McConnell (R-Ky.) said the rioters had tried to disrupt democracy. “They failed,” he said.

Sen. Mitt Romney (R-Utah) earned sustained applause from his colleagues for a thundering speech in which he said elected leaders should show respect for voters by telling them the truth, not fueling groundless doubts about the election.

“We gather due to a selfish man’s injured pride and the outrage of supporters who he has deliberately misinformed for the past two months and stirred to action this very morning,” Romney said. “What happened here today was an insurrection incited by the president of the United States.”

At one point early Thursday morning, the raw emotions nearly sparked a physical confrontation after Rep. Conor Lamb (D-Pa.) accused Republicans of peddling falsehoods about election fraud.

“That that attack today, it didn’t materialize out of nowhere,” Lamb said. “It was inspired by lies — the same lies that you’re hearing in this room tonight.”

That sparked an exchange of words between Republicans and Democrats sitting behind Lamb that nearly led to blows before aides intervened.

Both chambers picked up Wednesday night where they had left off before the evacuation, considering a challenge to Biden’s 11 electoral votes in Arizona. The Senate rejected the challenge by 93 to 6 and the House by 303 to 121.

House members also objected when Pence read the tallies from Georgia, Michigan and Nevada, but those challenges died when no senators joined them.

After midnight, however, a challenge to Pennsylvania’s count, joined by Sen. Josh Hawley (R-Mo.), prompted the two chambers to consider that state’s electoral vote. The Senate did not even debate before voting 92 to 7 to reject the challenge, while the House debated the full two hours ahead of a 282 to 138 vote of rejection.

Lawmakers then moved to reconvene the joint session and complete the counting of the remaining states, setting up a final confirmation of Biden’s victory at 3:45 a.m. — nearly 21 hours after the proceedings began.

Earlier in the day, the ceremonial reading of the electoral votes had just begun when pro-Trump rioters rushed the building at around 2 p.m., forcing the evacuation of both chambers of Congress. For hours, rioters rampaged through the Capitol complex. One woman was fatally shot in the building.

Only after the D.C. National Guard had been activated and political leaders in both parties condemned the rioting and appealed for calm did authorities declare the Capitol was secure.

The day had always been expected to be a historic test of the democratic system, with dozens of Republicans attempting for the first time to use Congress’s previously ceremonial role to try to overturn the results of a popular vote. The process was already underway when Jon Ossoff was declared the winner of one of two Senate runoffs in Georgia, handing control of the upper chamber to the Democrats for the next two years.

Still, the outcome of the congressional proceedings had been clear from the start, particularly after Pence announced he would reject pleas from the president to use his role as the session’s presiding officer to hand a win to Trump.

McConnell, who also had said little publicly about the process before Wednesday, likewise delivered a stirring opening floor speech imploring his colleagues not to damage democracy by objecting to the votes.

“Voters, the courts, and the states have all spoken — they’ve all spoken. If we overrule them, it would damage our republic forever,” he said.

The tense day turned to chaos when pro-Trump rioters, stirred up at a rally where the president called for them to march on the Capitol, stormed the building and caused the proceedings to be halted for hours.

The violence shocked leaders in both parties. While lawmakers huddled in an undisclosed location during the siege, Republican leaders pressed their members to abandon their plans to challenge the electoral vote. Several senators said they would no longer object, notably Sen. Kelly Loeffler (R-Ga.), who had embraced the challenge as part of the hard-fought Senate election she lost Tuesday. “The events that have transpired today have forced me to reconsider,” she said.

Democrats and some outside groups began calling Wednesday for Trump to be either quickly impeached by Congress or removed from office via the 25th Amendment to the Constitution, which guides the handling of an incapacitated president, in an effort to lessen his ability to incite more violence.

Several hours after his supporters had broken into the Capitol, Trump tweeted and released a video calling on them to respect law enforcement. But he also repeated lies about the election being stolen from him.

Late in the day, he tweeted that “these are the things and events that happen when a sacred landslide election victory is so unceremoniously & viciously stripped away from great patriots.” The tweet was quickly removed by Twitter, which also for the first time announced that Trump’s account would be locked until he deleted the tweet and then for 12 hours. Facebook and Instagram quickly said they also would lock Trump out of their platforms for 24 hours.

The congressional process was supposed to be a mere procedural checkpoint on the way to Biden’s oath-taking later this month. Biden won the popular vote on Nov. 3 and, last month, the electoral college met in each state capital, as stipulated in the U.S. Constitution. Biden won 306 electoral votes to Trump’s 232.

All that was left before the inauguration later this month was for a joint session of Congress to gather Wednesday and read those votes aloud.

According to an 1887 law that governs the process, any member of the House of Representatives, joined by a senator, can object to an individual state’s electoral tally, prompting a two-hour debate, followed by a vote in each chamber. A majority of both the House and Senate would have had to back a challenge for any to prevail, and Trump’s supporters did not have the votes.

Dozens of Republicans in the House, joined by 13 GOP Senators, had said they intended to object to slates of electors from several swing states that had backed Biden. They cited as their reason baseless allegations of fraud fanned by Trump, and the resulting belief among many Republicans that the election was compromised.

For days leading up to Wednesday, Trump had also pressed Pence, whom the Constitution requires to preside over the ceremony, to refuse to recognize electoral college slates from swing states that backed Biden.

Shortly before he took the gavel, however, Pence released a three-page letter he had written to members of Congress, rejecting Trump’s pleas.

“It is my considered judgment that my oath to support and defend the Constitution constrains me from claiming unilateral authority to determine which electoral votes should be counted and which should not,” he wrote.

A senior administration official, speaking on the condition of anonymity to describe private conversations, said Pence’s decision caused Trump to rage all afternoon even as the crowds were breaking into the Capitol, telling aides that Pence had betrayed him. Pence said he would merely preside over the reading of tallies that had been forwarded by the states. And then he opened the session, beginning alphabetically with the reading of votes from Alabama and Alaska, both of which backed Trump.

When Biden’s votes from Arizona were read aloud, Rep. Paul A. Gosar (R-Ariz.), joined Sen. Ted Cruz (R-Tex.) to object.

At that point, the House and Senate retreated to their respective chambers to debate the challenge, with Pence presiding over the Senate and Pelosi overseeing the House.

For nearly 30 minutes, the process ran largely as expected. McConnell pleaded for Republicans not to heed Trump’s call to object to the results.

“If this election were overturned by mere allegations from the losing side, our democracy would enter a death spiral,” he said, calling the vote the most important in his 36 years in the Senate.

Cruz insisted he was seeking only a 10-day audit of the results and not necessarily to overturn the election.

His remarks ignored that more than 90 state and federal judges, including jurists appointed by both Democrats and Republicans, have considered and rejected claims of fraud or other irregularities since the election.

But before debate in either chamber could get truly rolling, protesters — who had been attending a rally where Trump spoke and urged them to march on the Capitol — broke into the building and stormed the chambers, causing both the House and Senate to recess. As chaos erupted and Pence and Pelosi were hustled to secure locations, Republican Sens. Ben Sasse of Nebraska and Mike Rounds of South Dakota helped the parliamentarians grab the election certificates and take them to the secure location.

Constitutional experts said nothing in the law prevented Congress from picking up the ceremony where it left off. Even if for some reason it was unable to complete that process by Jan. 20, the Constitution is clear: The president’s term ends at noon that day.

“The idea that individuals were allowed to derail one of our most solemn sacred constitutional processes is horrifying. But this is only going to delay for a bit the completion of the process,” said Rick Pildes, a constitutional law professor at New York University School of Law.

If for some reason Congress were not able to confirm the electoral college vote between now and Inauguration Day, Pelosi would become acting president.

“What we absolutely know is that at noon on Jan. 20, the current term of both President Trump and Vice President Pence end,” said Edward B. Foley, a law professor at Ohio State University.

Paul Kane, Josh Dawsey and Felicia Sonmez contributed to this report.

The Jan. 6 insurrection

The report: The Jan. 6 committee released its final report, marking the culmination of an 18-month investigation into the violent insurrection. Read The Post’s analysis about the committee’s new findings and conclusions.

The final hearing: The House committee investigating the attack on the U.S. Capitol held its final public meeting where members referred four criminal charges against former president Donald Trump and others to the Justice Department. Here’s what the criminal referrals mean.

The riot: On Jan. 6, 2021, a pro-Trump mob stormed the U.S. Capitol in an attempt to stop the certification of the 2020 election results. Five people died on that day or in the immediate aftermath, and 140 police officers were assaulted.

Inside the siege: During the rampage, rioters came perilously close to penetrating the inner sanctums of the building while lawmakers were still there, including former vice president Mike Pence. The Washington Post examined text messages, photos and videos to create a video timeline of what happened on Jan. 6. Here’s what we know about what Trump did on Jan. 6.