RICHMOND — Four gun-control bills sailed out of a Senate committee Monday as the General Assembly's new Democratic majority took up firearms legislation for the first time.

In a visible show of opposition to the bills, gun rights activists swarmed the Capitol, where firearms were banned last week.

But the Senate Judiciary Committee advanced most of the gun legislation proposed by Democrats, who wrested control of the state House and Senate from Republicans in November after a campaign season largely focused on guns and public safety.

The bills now headed for the full Senate would require background checks on all firearms purchases, allow law enforcement to temporarily remove guns from individuals deemed a risk to themselves or others, let localities ban weapons from certain events and government buildings, and cap handgun purchases at one per month.

The hearing opened on the first business day after Democrats on Friday imposed a ban on guns in the Capitol. The ban was approved by a joint House-Senate committee with the power to set policy for the Capitol and the adjacent Pocahontas Building without review from the full legislature.

The move angered Republicans accustomed to carrying firearms on the floor of the House and Senate, and it drew hundreds of gun rights activists — some wearing bright orange “Guns Save Lives” stickers — to Capitol Square on Monday.

“It’s a wholesale assault on constitutional rights,” said Lindsay Trittipoe, 61, of Richmond.

Amid concern about a potentially violent backlash to the restrictions, the teenagers who usually work as House and Senate pages were given Monday off, and a large number of State Police troopers were dispatched to help Capitol Police.

Inside the Pocahontas Building, the National Rifle Association’s lobbying arm rewarded activists with T-shirts and 30-round magazines, absent any ammunition.

Lines stretched for blocks as visitors waited to pass through metal detectors at the front doors of the building. Legislative staffers, who until Monday had been exempt from screening, were directed to another blocks-long line at a rear entrance.

Arnold Farber, 73, a retired computer specialist from Hanover, said the gun ban and the gun-control legislation Democrats have in the hopper prompted him to make his first trip to the Capitol. He said he had never attended a gun rights event until his county — like more than 100 other counties, towns and cities in Virginia — recently declared itself a Second Amendment “sanctuary” where local law enforcement will refuse to enforce new gun restrictions.

“We never had an attack [on gun rights] like this before,” Farber said.

Democrats expect to adopt far-reaching gun-control legislation this year, now that they have control of the state House, Senate and Executive Mansion for the first time in a generation.

Several of the 10 bills taken up Monday morning were combined because they were similar. The only proposal that did not advance was one filed by Senate Majority Leader Richard L. Saslaw (D-Fairfax), which he moved to strike at the start of the meeting. The measure, which called for a ban on the sale and possession of assault weapons, had caused an uproar since it would have required people who legally purchased the guns in the past to give them up.

Democrats will later take up bills, including those supported by Gov. Ralph Northam (D), to outlaw the sale of assault weapons but not possession of them.

Sen. Chap Petersen (D-Fairfax) successfully pushed to dilute a background-check bill brought forth by Sen. L. Louise Lucas (D-Portsmouth). As originally proposed, the measure would have required criminal background checks on any gun sales or transfers. Petersen persuaded the committee to exempt transfers from the requirement.

Lucas and various gun-control groups opposed the change, as did a representative for Attorney General Mark R. Herring (D) and Brian Moran, Northam’s secretary of public safety and homeland security. Critics said the transfer exception would create a dangerous loophole, but the committee voted for it.

The one-gun-per-month bill, which would reinstate a law that was in place from 1989 to 2012, includes an exception for concealed-carry permit holders.

The Capitol gun ban applies to lawmakers and visitors. Previously, visitors could carry guns into the Capitol and the House gallery with a concealed-carry permit, although they were not allowed in the Senate gallery.

But as a practical matter, Capitol Police Col. Steve Pike said Friday, the policy will not be enforced with lawmakers, who are not required to pass through metal detectors. He also noted that lawmakers are immune from prosecution during the session, under a law intended to ensure that legislating is not impeded.

Lines at the checkpoints were a major source of complaint Monday. Lawmakers were able to breeze through, but their staffers endured long waits, along with lobbyists and members of the public. Some lobbyists with outdated credentials had their ­badges confiscated. One waiting in line could be overheard saying, “I’m starting to like Republicans more than I ever did before.”

Even U.S. Sen. Tim Kaine (D), a former governor, was turned away when he tried to bypass the lines and get into the office building to deliver doughnuts. A man who tried to get in with a bow and arrow also was denied entry, said Capitol Police spokesman Joe Macenka.

House Minority Leader Todd Gilbert (R-Shenandoah) asked Speaker Eileen Filler-Corn (D-Fairfax) to revise the policy so credential-holders could get in more quickly. But Del. Marcus Simon (D-Fairfax) said change is unlikely.

“Obviously there is some inconvenience and some growing pains and first-day issues — that’s to be expected,” Simon said. “But we remain committed to ensuring the safety of everyone who comes to the Capitol.”

Most of the House Republican delegation held a news conference with lobbyists and members of the NRA as the Senate committee debated gun bills.

Gilbert told an emotional crowd that Democrats “are about to fracture this commonwealth, turning it into two Virginias. . . . The notion that you can legislate away evil and bad things in this world is folly.”

Gilbert said later that Republicans lack the numbers to block most of the bills but will work to change them. “Any concessions we can achieve are certainly an improvement,” he said.

Gun-control bills have yet to come before any House committees. Some of the most vocal gun rights Republicans have been removed from the Public Safety Committee, where those bills are likely to get their first House hearings.

“Clearly it’s a new day in Virginia when Senate Judiciary moves four bills,” said Lori Haas, Virginia director for the Coalition to Stop Gun Violence. “Elections have consequences, and they’re reacting to the mandate of the voters.”