Gun-rights groups asked a judge Thursday to lift a ban on guns that has been imposed for a massive pro-gun rally scheduled next week on the grounds of Virginia's Capitol.

Gov. Ralph Northam on Wednesday announced a state of emergency and banned all weapons from the rally, citing threats that armed militia groups were planning to attend. The Virginia Citizens Defense League and Gunowners of America filed a lawsuit Thursday seeking an injunction specifically against the ban on firearms.

The lawsuit came the same day the FBI announced the arrest of three alleged white supremacists in Maryland, two of whom authorities said had built an assault rifle using several parts and purchased large quantities of ammunition.

David Browne, an attorney for the gun-rights groups, argued that prohibiting rallygoers from carrying guns would violate their Second Amendment right to bear arms and their First Amendment right to free speech. Browne said carrying guns is a form of symbolic speech.

Virginia's solicitor general, Toby Heytens argued that the governor was well within his authority to declare the state of emergency and ban weapons after law enforcement identified "credible evidence" that armed out-of-state groups planned to come to Virginia with the possible intention of participating in a "violent insurrection."

Heytens said the alleged white supremacists arrested Thursday had discussed traveling to Richmond “to engage in a race war.”

Richmond Circuit Court Judge Joi Taylor said she would issue her ruling later Thursday.

While the court challenge was going on, Virginia senators were debating a package of gun-control bills.

Senate is done for the day. Here’s an updated version.

While the court challenge was going on, Virginia senators were debating a package of gun-control bills.

The Democrat-led Senate advanced legislation limiting handgun purchases to once a month, requiring universal background checks on gun purchases, and allowing localities to ban guns in public buildings, parks and other areas. The measures largely passed along partisan lines and will now go to the House for consideration.

Democrats said they were reasonable measures that would improve public safety while respecting the rights of law-abiding gun owners. They said the public had made clear by voting for Democrats in recent elections that new gun laws were needed.

"The citizens in these last two elections have spoken,” said Democratic Sen. Dave Marsden.

Republicans decried the legislation as an assault on the Second Amendment launched to appease special interest groups and donors such as Democratic presidential hopeful Michael Bloomberg. GOP senators said the new laws would entrap innocent people and do nothing to stop bad actors.

"This may be what you think is safety, but it is not,” said Republican Sen. Bill Stanley.

Associated Press reporters Alan Suderman in Richmond; Michael Kunzelman in College Park, Maryland; and Mike Balsamo in Washington in contributed to this report.