OAKLAND -- A federal judge on Monday denied requests to shut down the nation's largest medical cannabis operation, setting up a legal battle later this month between the city of Oakland and federal prosecutors.

In a 17-page order, Chief Magistrate Judge Maria-Elena James found that the landlords of Harborside Health Center "have no right of action" under the federal Controlled Substances Act to force the cannabis dispensary "to cease its operations."

The owner's of Harborside's Oakland and San Jose locations have been trying to evict the dispensary since U.S. Attorney Melinda Haag filed suit last July threatening to seize the properties because they are rented to a business that sells cannabis.

Oakland, which last year received more than $1 million in tax revenue from Harborside, has filed suit against the federal government, challenging the forfeiture action. Attorneys for the city had asked James not to shut down the dispensaries before its challenge was heard.

Federal prosecutors have filed a motion to dismiss the city's case. A hearing on the federal government's motion is scheduled for Jan. 31.