Around 2:15 p.m., as the House and Senate debated a move by a faction of Republicans to overturn the election results, the proceedings ground to a halt as security rushed Vice President Mike Pence out of the Senate chamber and the Capitol building was placed on lockdown, with senators and members of the House locked inside their respective chambers. Shortly afterward, the police escorted senators and members of House from the building to others nearby, as the protesters swarmed the hallways just steps from where lawmakers were meeting, carrying pro-Trump paraphernalia.

The extraordinary day in Washington laid bare deep divisions both between the two parties and within Republican ranks, when the ceremonial counting of electoral votes that unfolds every four years in Congress was transformed into an explosive spectacle, with Mr. Trump stoking the unrest.

“This is what you’ve gotten, guys,” Senator Mitt Romney, Republican of Utah, yelled as the mayhem unfolded in the Senate chamber, apparently addressing his colleagues who were leading the charge to press Mr. Trump’s false claims of a stolen election.