WASHINGTON — They slept on the marble floors, lined up for coffee in the 24-hour snack bar and marveled at the marble likenesses of the nation’s founders in the Rotunda and Statuary Hall. They snapped photos with their phones, ate pizza and sometimes played cards, their M4 carbines at their sides.

Throngs of armed, camouflage fatigue-clad members of the National Guard ringed the Capitol and lined its halls on Wednesday, weapons, helmets and backpacks stacked seemingly in every corner of the complex. The heavily militarized presence provided a jarring and sobering backdrop to the House chamber as a majority of lawmakers moved to impeach a sitting American president for inciting an insurrection on the nation’s Capitol.

It evoked reminders of the rioters who just one week earlier had stormed the complex as its terrified occupants took shelter inside the barricaded House chamber and secure locations across the Capitol — and the recriminations that remained before President-elect Joseph R. Biden Jr.’s inauguration.

“It doesn’t belong here,” Representative Elaine Luria, Democrat of Virginia and a veteran who served 20 years in the Navy, said of the military presence in the building. “It is something that is out of place.”

“I hate the idea that we’re going to change in a way, be harder more difficult or more cumbersome for people to come enjoy the historic monument that this is because of what happened last week,” she added.

Much like the lawmakers, aides and reporters who were still exchanging accounts of where they were during the siege of Trump supporters, Capitol Hill on Wednesday appeared to be torn between nursing the open wounds left by deadly riots and the need to lay the groundwork for healing under a new administration.

Capitol workers feverishly worked in recent days to complete preparations for the inauguration on Jan. 20 — hanging blue curtains over the entrance to the Rotunda and brushing dust off the statues — among reminders of the violence. Window panes remained splintered and cracked in parts of the Capitol and two holes were left over the entry to the office of Speaker Nancy Pelosi of California after rioters stole her embossed wood plaque.

Freshman lawmakers delivered their maiden floor speeches on the merits of charging President Trump with high crimes and misdemeanors for inciting an insurrection. After a majority of the House voted to impeach Mr. Trump, Ms. Pelosi spoke from the same lectern that a Trump loyalist had been photographed gleefully hauling across the Capitol.

“I don’t have enough adjectives to describe how disgusted I am with what happened and the point that we’re at — it’s sad, it’s disgusting, it’s sad,” said Representative Brian Mast, Republican of Florida. An Army veteran who lost his legs while serving in Afghanistan, he gave tours of the Rotunda to members of the Guard as a way of showing gratitude for their service. (Mr. Mast also voted to overturn the results in both Arizona and Pennsylvania, and expressed no regret about those votes. He was not among the 10 Republicans who voted to impeach Mr. Trump.)

Some lawmakers lamented the threat that made the military’s presence necessary, with many Democrats irate about the role they said their own Republican colleagues had played in whipping up the rage of the mob that assaulted the Capitol, putting lawmakers’ lives in danger.

“It should not and will not be tolerated,” Representative Hakeem Jeffries, Democrat of New York, told reporters. “And that’s why extraordinary security measures have been taken.”

In response in part to concerns about Republicans bringing guns to the House floor, new magnetometers have been installed outside the doors to the chamber, a security measure that was challenging for several lawmakers. Typically allowed to bypass the magnetometers at the entrances to the building, several Republicans grumbled about the added layer of security and some made a point of pushing past police officers despite setting off the alarm.

“You’re taking valuable resources completely away from where it needs to be without any consultation, and you guys did it without any consultation from the minority,” Representative Rodney Davis of Illinois, the top Republican on the House Administration Committee, seethed on Tuesday to Representative Steny H. Hoyer of Maryland, the majority leader. With multiple people testing positive for the coronavirus after sheltering in a room with maskless Republicans, Democrats also enforced a fine system for refusing to wear a mask on the chamber floor.

The magnetometers and heightened security were a small comfort during the vote to impeach Mr. Trump given that several lawmakers were still shaken and questioning the ability to attend inauguration safely. On Wednesday, Ms. Pelosi said that the House would vote this month on a rule change that would enforce a fine system for refusing to adhere to the new security protocols, deducting $5,000 and $10,000 from member pay for the first and second offenses.

“What we’re dealing with now is combating an insurrection, so I feel like everything upside down,” said Representative Colin Allred, Democrat of Texas, who recalled whipping off his jacket on the House floor and preparing to defend his colleagues against the rioters. “To see National Guardsmen sleeping in the halls, to have the necessary protection of having metal detectors put up to go onto the House floor — I know the word ‘unprecedented’ is used a lot, but this is unprecedented. And it’s also so sad, just so sad.”

“It’s intended to be open,” Mr. Allred added of the Capitol. “It’s a museum, it’s a place where ordinary Americans should feel like they can come and watch the government work.”

But while it houses both artifacts of American history and the holders of the highest offices of American democracy, the Capitol complex is in ordinary times an accessible fortress. But with tourists barred as a way to stop the spread of the coronavirus, the presence of hundreds of armed troops was even more disconcerting after months of near-empty hallways.

Several of the soldiers craning their necks to look at the paintings and sculptures etched into the ceiling of the Rotunda said they had never been to the Capitol, even as tourists. Their colleagues in another room could be seen dozing next to a plaque commemorating troops who were quartered in the Capitol in 1861, in Statuary Hall, and a small group posed for a photo with the statue of Rosa Parks.

John Ismay and Luke Broadwater contributed reporting.