A group of local residents, gun stores and gun rights organizations including the NRA have filed a federal lawsuit against four Bay Area counties for mandating that gun stores close as "non-essential businesses" during the region's coronavirus outbreak.

The lawsuit, filed with the U.S. District Court for Northern California Tuesday, alleges that local officials from Alameda, Contra Costa, Santa Clara and San Mateo counties violated the United State Constitution's Second and Fourteenth Amendments by ordering that gun stores be closed.

"California’s local governments cannot simply suspend the Constitution," the lawsuit states. "Authorities may not, by decree or otherwise, enact and/or enforce a suspension or deprivation of constitutional liberties. And they certainly may not use a public health crisis as political cover to impose bans and restrictions on rights they do not like."

In the 2008 case District of Columbia v. Heller, the United States Supreme Court held that the Second Amendment guarantees an individual right to keep and bear arms for lawful purposes. The lawsuit cites Heller as precedent localities are directly violating by denying the "right of law-abiding, responsible citizens to use arms in defense of hearth and home.” The Second Amendment was made fully applicable to state and local governments through the Due Process and Privileges or Immunities Clauses of the Fourteenth Amendment in the 2010 Supreme Court case McDonald v. City of Chicago. That case is also cited in the lawsuit against Bay Area officials.

There has been a surge of business at local gun stores in response to unrest caused by the COVID-19 pandemic, but a number of counties have insisted that the stores are non-essential and be closed.

A high-profile incident occurred two weeks ago in Alameda County, when the county's sheriff office initially ordered Solar Tactical to close its locations in Castro Valley and Livermore. The owner refused, and a confrontation on social media ended with the stores remaining open with only "minimum operations."

The lawsuit states that businesses could close without violating the Second Amendment if arms and ammunition could be purchased online.

"If firearms and ammunition could be purchased online like other constitutionally protected artifacts, such as paper, pens, ink, and technology products that facilitate speech, then individuals could simply purchase what they need and have the items delivered to their doorsteps," the lawsuit states. "But because of an onerous and complicated federal, state, and local regulatory scheme, people in California cannot exercise their Second Amendment right to keep and bear arms without going in person to such essential businesses."

It's unclear how federal judges will respond, but Los Angeles County backtracked on an order to close gun stores after legal counsel for the county advised against it.

You can read the full lawsuit here.

MORE CORONAVIRUS COVERAGE:

Sign up for 'The Daily' newsletter for the latest on coronavirus here.

Eric Ting is an SFGATE digital reporter. Email: eric.ting@sfgate.com | Twitter:@_ericting