RICHMOND, Va. ─ Thousands of gun rights activists, banned from carrying their weapons out of fear of violence, crammed into the Virginia Capitol on Monday to urge state lawmakers to reject sweeping measures to limit the spread of firearms.

The rally, planned for weeks as part of a citizen-lobbying tradition held on Martin Luther King Jr. Day, has focused national attention on Virginia's attempts to enact new gun regulations, pushed by Democrats who took control of the Statehouse for the first time in 26 years. Gun control supporters say they are acting on voters' wishes, propelled by a mass shooting in May in Virginia Beach.

Gun rights proponents warn that the measures ─ including bills that would impose universal background checks, ban military-style rifles and allow authorities to temporarily take guns from people deemed dangerous to themselves or to others ─ will snowball into attempts to disarm the public.

Download the NBC News app for breaking news and politics

"We will not comply," activists chanted from both sides of a security fence ringing the Capitol grounds. The crowd was largely white and diverse in age, with most wearing orange stickers saying "Guns save lives." Many rode chartered buses from all over the state and waited hours in line to get into the Capitol grounds before passing through airport-style security. On the other side of the fence, large crowds formed, and many activists openly carried firearms, including long guns. Many also wore camouflage and military gear.

About 22,000 people attended the rally, 6,000 on Capitol Square and 16,000 outside the security gates, authorities said.

Members of an armed militia group arrive near the Virginia Capitol building to advocate for gun rights in Richmond on Monday, Jan. 20, 2020. Stephanie Keith / Reuters

In the days leading up to the rally, there were fears that it would be a repeat of the violent 2017 protest in Charlottesville that ended in a woman's death. Gun safety groups canceled a MLK Day vigil at the Capitol that was supposed to begin after the gun rights rally.

But the rally was largely peaceful, with no reported violence, despite the presence of some extremist groups. Their potential participation had been cited as a reason for Gov. Ralph Northam, a Democrat, to declare a state of emergency last week, banning guns and other weapons from the Capitol grounds.

Police announced one arrest: a 21-year-old Richmond woman charged with wearing a mask in public after she allegedly ignored an officer's warnings to remove a bandanna covering her face.

Nicholas Freitas, a Republican member of the Virginia House of Delegates, spoke to supporters, many of whom were armed, outside the Capitol cordon. Freitas, who represents three counties in northern Virginia, said the threat of violence from outside groups was overblown, and that Northam had been wrong to issue the weapons ban. He said he felt safer there than “inside those cages” where the gun ban was being enforced.

“I’m not going to tell one of my constituents who is a law-abiding gun owner who has never broken the law, I'm not going to tell them you have to choose between lobbying me or having the means to defend yourself,” Freitas told reporters. “That shouldn’t be an either-or proposition.”

Jay Lowe, who was in the crowd on the Capitol grounds, said gun control supporters were wrong to think that people were safer where firearms were restricted. “So many people are misinformed and think you are safer because you take my guns away," Lowe, who lives in Chesterfield County, south of Richmond, said. “My guns have never killed anybody. And I carry a lot."

Lowe also said he was angry that the rally had been tainted by links to hate groups.

"They are not the right. Conservatives are the right. We are not like those people,” Lowe said. “If there are Nazis here, white supremacists, they are not welcome by me. I do not want them on my side ever.”

Northam's declaration of a state of emergency last week cited "credible intelligence" from law enforcement that armed militias and hate groups were threatening violence. Gun rights groups, led by the Virginia Citizens Defense League, which organized the rally, tried unsuccessfully to get a court to overturn the ban.

A day after Northam's announcement, federal authorities said they had arrested three members of a neo-Nazi group called The Base, who law enforcement officials said had been planning to attend the rally. More alleged members of the group were arrested Friday.

Gun rights advocates attend a rally organized by the Virginia Citizens Defense League on Capitol Square near the state Capitol building in Richmond on Monday. Zach Gibson / Getty Images

There were some signs of militia members in the crowd Monday, but the rally seemed made up largely of ordinary gun rights supporters, including many sporting shirts and hats proclaiming their support of President Donald Trump. There were chants calling on Northam to resign and shouts calling journalists "fake news."

The prevailing concern among participants was that the Virginia measures would mark a slow erosion of rights that would expand beyond guns. Many said they saw an imbalance in the way gun owners were being targeted by the laws while other policies sought to protect undocumented immigrants or reduce the number of people in prison.

"Why are you going after the people that don’t commit crimes?" said Sue Ferrick, a nurse from Salem, Virginia. "We see that the people who commit crimes are getting more favors and we’re getting more stripped away from us."

Warren Baker, who traveled from Hanover, Connecticut, to attend the rally, added: "Criminals are not going to give up their guns. So they will have guns and we won’t."

At the rally podium, speakers railed against the gun control measures, accusing Democrats of disregarding the Constitution and abusing citizens’ rights. Some vowed to seek ways around the laws.

“I will choose to deputize thousands of my citizens to see they’re able to keep their lawfully owned firearms and not be disarmed,” Culpeper County Sheriff Scott Jenkins said.

On Sunday night, as activists prepared for the rally, there were tense exchanges around the Capitol. A group of men interrupted a television reporter who referred to “extremist groups from out of town," saying they were "freedom lovers, patriots." Conspiracy theorist Alex Jones filmed a video at the top of the Capitol steps. A group of people identified themselves as members of the Proud Boys, a far-right organization designated a hate group by the Southern Poverty Law Center, that has clashed with anti-fascist demonstrators in other parts of the country.

As the rally ended, Vanessa Dallas of Virginia Beach said she thought the day had been peaceful. On a street right outside the Capitol, she figured she was standing in the safest place in the state.

“We’re the good guys. We’re not the ones out committing the crimes,” Dallas said. “We just want to have our guns to protect ourselves, to go to target practice, go to the range.”

Ben Kesslen reported from Richmond, Jon Schuppe from New York.