A U.S. magistrate judge on Thursday sided with federal prosecutors in dismissing a lawsuit by the city of Oakland that challenged as illegal federal attempts to shutter the nation’s largest medical marijuana dispensary.

In filing the suit last October, Oakland became the first city to take on federal enforcement actions that have led hundreds of dispensaries to close in recent years.

Attorney Cedric Chao, representing Oakland, had argued that the city has broad interests in ensuring Harborside Health Center remains open, as its closure would compel many of the dispensary’s 108,000 patients to turn to the illegal market, triggering a public health and safety crisis.

But U.S. Magistrate Judge Maria-Elena James ruled there was no appropriate legal avenue for Oakland’s intervention.

Federal attorneys had moved to dismiss the suit against U.S. Atty. Gen. Eric Holder and Melinda Haag, U.S. attorney for the Northern District of California, on grounds that any party seeking to weigh in on an asset forfeiture must do so within a specified period of time, which had elapsed.

Chao had countered that since Oakland has no direct interest in the Harborside property, the city instead sought to litigate its concerns under the Administrative Procedure Act, which governs the way federal agencies propose and establish regulations.