A federal judge on Monday denied a request by gun-rights groups to prevent California from shutting down gun stores during the coronavirus crisis in a legal battle that could end up before the Supreme Court.

Second Amendment activists had filed a federal suit to block California localities from including gun stores in emergency shutdown orders related to the coronavirus. Judge André Birotte Jr. denied the request, ruling that Los Angeles County—where the case was filed—or any other jurisdiction could close gun stores to prevent the spread of the virus.

"The City's and County's stated objective—reducing the spread of COVID-19, a highly dangerous and infectious disease—undoubtedly constitutes an important government objective," Birotte said in the ruling. "The closure of non-essential businesses, including firearms and ammunition retailers, reasonably fits the City's and County's stated objectives."

The Firearms Policy Coalition (FPC), which brought the case alongside the National Rifle Association and Second Amendment Foundation, vowed to appeal the decision and is prepared to take the legal challenge to the nation's highest court.

"The Court's awful ruling in this matter is far from the end of this lawsuit," the group said in a statement. "We will continue to seek a preliminary injunction in this matter and are prepared to seek relief from the Ninth Circuit and the Supreme Court should doing so be necessary to end these unconstitutional bans, defend liberty, and fight for the rights of our members and the public."

The ruling is the second setback in gun-rights activists' fight against the temporary shutdowns of gun stores in the state. In March, another federal judge refused to block a shutdown in neighboring Ventura County. Both judges concluded the temporary bans on gun sales were "simply not as sweeping as the complete handgun ban" that the Supreme Court struck down in the 2008 District of Columbia v. Heller decision. The coalition called the legal justification of mass closures "utterly absurd and misguided."

"Unfortunately, the Court's utterly absurd and misguided constitutional analysis allowed the City of Los Angeles and other defendants to continue violating the fundamental, individual rights of millions of people in Los Angeles County," the group said in a statement.

Alan Gottlieb, founder of the Second Amendment Foundation, told the Washington Free Beacon the ruling "was expected" because temporary restraining orders are "always a high bar" and getting one is akin to "a three-point shot from mid court."

Gun-control activists have been calling on states to crack down on gun and ammunition stores during the outbreak. Kris Brown, president of the gun-control group Brady United, said gun-rights groups put "consumers at risk" of contracting the virus.

"All of the Amendments in the Constitution are limited by other rights enshrined in law, including the public’s right to safety," he said in a statement. "[The] decision recognizes that the public health interest in curbing Coronavirus requires extraordinary measures to be taken to protect our public health and well being…. The Second Amendment is not absolute, and it does not entitle people to spread coronavirus while shopping for guns."

The ruling is unlikely to have an immediate effect in Los Angeles County, despite the court ruling. After a series of flip-flops, Sheriff Alex Villanueva (D.) announced on March 31 that he would allow gun stores to reopen. Second Amendment activists have enjoyed more success convincing policymakers to reverse gun-store closures than they have in their legal campaign. Advocates convinced the federal government to label gun businesses as "essential" in coronavirus guidelines—a decision several states and localities have cited in reversing shutdown orders.

Activists have filed several other federal and state cases outside of California and have also set their sites on Massachusetts, which removed gun stores from its "essential" business list after the federal guidelines were released.