Image caption Protesters gathered after a raid in September on a 7,000-plant farm in northern California

Dozens of medical marijuana dispensaries in California have been ordered to close from Saturday, as a federal crackdown looms.

Distributors and their landlords were told in late September to shut down in 45 days or face prosecution.

Some marijuana distributors filed for a temporary restraining order earlier this month.

California legalised medical marijuana in 1996, but use of the drug remains illegal under federal law.

US attorneys have said they are targeting large dispensary operators and growers, instead of individuals. For-profit sales are in violation of California's state law.

The BBC's Peter Bowes, in Los Angeles, reports that some outlets appear to have been targeted because they are near schools and parks.

Federal prosecutors say they are focusing on towns and cities that have already banned marijuana shops.

'Breaking point'

Matthew Kumin, a lawyer for the pro-marijuana group NORML, told reporters earlier this week that the federal government's marijuana policies were not consistent.

"The government's irrational policy has reached a breaking point," he said. "The federal government said it will not prosecute patients, and yet they want to shut off their supply. This doesn't make sense."

The complaint, filed in four US district courts in California, says a federal crackdown contradicts an agreement from a previous court case.

In that case, the federal government said it would not use its own power against marijuana patients who were acting within the guidelines of state law.

Medical marijuana advocates also contend threatening to close down dispensaries is a violation of the 10th amendment to the US constitution,

But federal officials say they are well within the law.

"Unless and until ordered otherwise, we will continue to do our duty in enforcing federal narcotics laws," the US attorney for the Eastern District of California told the New York Times in a statement.

While the NORML suit is the second such filing in California, Mr Kumin told the Los Angeles Times that only a few so-called pot collectives and landlords wanted to publicly fight.

"Everybody's gone underground," he said.

Medical marijuana advocates in California say the drug is a key element of palliative care for patients with a range of conditions, including cancer, chronic pain, glaucoma and arthritis.

Elsewhere in the US, the District of Columbia and 15 additional states allow patients to possess marijuana with a doctor's prescription.

But many fear the prescriptions are misused and the drug is in effect being made legally available to healthy recreational users.