Oakland’s attempt to block the federal government’s shutdown of the nation’s largest medical marijuana dispensary has gone up in smoke.

A federal appeals court on Thursday rejected the city’s intervention in the U.S. Justice Department’s effort to close down Oakland’s Harborside Health Center, concluding that the legal move interferes with the federal government’s powers under forfeiture laws to move against what it considers illegal activity. The 9th U.S. Circuit Court of Appeals, in a unanimous three-judge ruling, found Oakland had a right to sue, but that its legal arguments would undercut federal drug enforcement powers.

The 9th Circuit was reviewing a 2013 lower court ruling tossing out Oakland’s lawsuit, which argues that a federal government shutdown of one of four city-approved and regulated medical marijuana outfits harms the city’s interests and clashes with California’s 1996 law permitting medical pot use.

Despite that ruling, U.S. Magistrate Judge Maria-Elena James has put the government’s forfeiture case against Harborside on hold while the appeals court reviews the issues — a move that has allowed the dispensary to continue to sell medical pot to patients in Oakland and at its smaller facility in San Jose. Thursday’s ruling could allow federal law enforcement officials to move to close down the operation.

But Harborside officials disagree.

“This ruling is not going to have any real-life effect on Harborside or our patients in the foreseeable future,” Harborside Executive Director Steve DeAngelo said. “This is just one more step in litigation that’s been going on for several years, and we are expecting to continue for several more years unless the federal government decides to dismiss the case.”

Oakland City Attorney Barbara Parker said she will consult with city officials on whether to seek a full 11-judge panel review, the first step before appealing to the U.S. Supreme Court.

“I was very pleased that the court agrees that city of Oakland will suffer significant grievous injury if Harborside closes down,” Parker said. “I’m perplexed by the court’s other finding that despite recognition that we will have this injury, there’s no remedy for it.”

San Francisco U.S. Attorney Melinda Haag two years ago moved to shutter Harborside, labeled a medical pot “superstore,” because it is so large that it was alleged likely to sell to customers who could not prove a medical need.

But since going to court to shut down the $20 million-a-year operation, the government’s approach to medical marijuana has shifted. In a recent development, Congress included a provision in December spending legislation — signed by President Barack Obama — that appears to bar the federal government from using resources to prosecute medical marijuana providers in the 32 states where it is legal.

Haag, who filed the forfeiture action against Harborside, has declined to comment on the case. And U.S. Justice Department officials, who are defending the government against Oakland’s lawsuit in the 9th Circuit, say the legislation is irrelevant to Oakland’s core arguments.

Harborside’s supporters are using the legislation to back Oakland’s arguments, telling the 9th Circuit in court papers that the congressional action “reaffirms the government’s policy of non-prosecution of persons acting in compliance with state and municipal laws regarding medical marijuana.”

Oakland city officials maintain that shuttering Harborside will damage city interests in numerous ways, from losing tax revenue from a legal, regulated local business to driving those marijuana sales into the black market and boosting crime.

The Obama administration in recent years has shifted course on medical marijuana enforcement, for the most part abandoning prosecution in states where medical weed is legal. California voters approved medical pot in 1996.

But there have been some crackdowns, primarily aimed at dispensaries proliferating without much oversight in areas such as near schools and parks. The Harborside action came before some of the more recent shifts in Justice Department enforcement.

Staff writer Malaika Fraley contributed to this report. Howard Mintz covers legal affairs. Contact him at 408-286-0236 or follow him at Twitter.com/hmintz