RICHMOND — Newly empowered Virginia Democrats on Friday banned guns from the State Capitol, muscling through a sharp policy shift in a place where lawmakers often pack heat on the floor.

The policy, adopted over vehement Republican objections, is a first strike for gun control by the House and Senate, both under Democratic control for the first time in decades.

The legislature is expected to pass far-reaching gun restrictions before the 60-day session that began Wednesday wraps up.

“Our objective here is keeping everyone safe,” House Speaker Eileen Filler-Corn (D-Fairfax) told reporters. “It’s being done in countless states throughout the United States.”

The policy, which was set to take effect at midnight Friday, pointedly applies not just to visitors, who until now have been allowed to bring weapons into the building if they have a concealed-carry permit. The ban also applies to senators and delegates — even those who are law enforcement officers.

But as a practical matter, Capitol Police Col. Steve Pike said, the policy will not be enforced with lawmakers. Requiring them to pass through metal detectors would probably slow them down as they travel between the Capitol and the adjacent Pocahontas Building, which the ban also covers. In addition, he said, legislators are immune from prosecution during the session, under a law intended to ensure their performance of the people’s business is not impeded.

Gov. Ralph Northam (D) applauded Friday’s policy change, which mirrors gun bans already in place in executive-branch buildings. His office said he, along with state and local law enforcement, is reviewing options for regulating weapons in outdoor areas of Capitol Square, “in light of incoming intelligence” — a reference to plans for an enormous gun rights rally planned for Jan. 20.

Organizers say that event could draw tens of thousands of heavily armed protesters, including militias and members of extremist groups from across the country.

“The other side is very, very, very ugly right now, and the threats are real,” said Lori Haas of the Coalition to Stop Gun Violence. “I don’t begrudge them being careful.”

One lawmaker hinted Friday that she will not quit carrying in the Capitol, regardless of the policy change.

“I’m going to uphold the U.S. Constitution and the Virginia Constitution, so help me God,” said Sen. Amanda Chase (R-Chesterfield), who drew attention last year by wearing a .38 special on her hip. This year, she has been carrying a weapon in her American-flag-patterned purse.

If Capitol police officers are made aware that a lawmaker is violating the policy, Pike said, “I will go to the leadership of both bodies and explain to them what is going on.”

Asked what he would do if leaders responded by instructing him to escort a lawmaker out, Pike hesitated. “I’m going to have to think on that,” he said.

The gun ban was imposed by the Joint Rules Committee, a panel of House and Senate members whose decisions on Capitol policy are not subject to review by the full legislature. Democrats outnumber Republicans on the panel 11 to 5, and the vote fell along party lines.

Guns are expected to be the marquee issue this session, after Democrats — many running on gun-control platforms — wrested control of the House and Senate from Republicans in November. The issue took on greater prominence after a gunman killed 12 people at a Virginia Beach municipal building in May and Republicans did not take action on gun control at a special session that Northam called in the aftermath.

Northam is advocating eight bills, including measures to ban the sale of assault-style weapons; require background checks on all firearms sales and transfers; cap handgun purchases at one per month; and create a “red flag” law to temporarily remove guns from people deemed a threat to themselves or others.

Republicans complained bitterly that they had gotten word of the Rules Committee meeting only the night before.

“This is something that has been recommended by our Capitol Police,” House Majority Leader Charniele Herring (D-Alexandria) responded. “There are times when we sort of have to trust what our law enforcement officers are telling us in concern for our safety and the safety of individuals that are coming into this building.”

Filler-Corn invoked the same reasoning: “Again, this is being recommended by Colonel Pike and the professionals and that’s why we’re moving in this direction.”

Pike later made clear that he had not recommended the policy itself, just the mechanics of implementing it. “They approached me and said [if] they wanted to put a prohibition in place, how would that be handled?” Pike said.

Republicans then accused Democrats of trying to pin the policy change on Capitol Police, something House Minority Leader Todd Gilbert (R-Shenandoah) called “disgusting” and “downright dirty.”

Former House speaker Kirk Cox (R-Colonial Heights), who has kept a low profile since losing his leadership position, confronted the new speaker on the issue directly.

“Let’s be honest with each other,” he said to Filler-Corn. “That was a deliberate misrepresentation. There’s just no way around that.”

Filler-Corn did not directly respond but later told reporters that Pike was correct: the police did not recommend the policy change, only the method for implementing it. She added that Republicans’ charge that Democrats were intentionally misleading was “absolutely ridiculous. They’re trying to change the narrative.”