Mr. Courtney said that the agency had raided only a fraction of the thousands of marijuana dispensaries now operating and that agents had used discretion to go after only the worst offenders.

Image Jars of medical marijuana. Federal officials are curbing raids. Credit... Michal Czerwonka for The New York Times

Thom Mrozek, a spokesman for the United States attorney in Los Angeles, said his office had prosecuted only four medical marijuana dispensary cases since the passage of Proposition 215, a 1996 ballot measure that made California the first state to legalize medical marijuana. That measure set off a decade-long fight over several legal issues.

The case of Charles Lynch, a dispensary operator whose business was raided on the same day as Mr. Duncan’s, was the most prominent. Mr. Lynch was convicted and will be sentenced on Monday in federal court. He faces a minimum of five years in federal prison for charges that included selling to a minor under the age of 21.

Mr. Lynch’s lawyers argued that he violated no state laws while operating his dispensary and said that by registering with the local Chamber of Commerce and paying taxes, he was working to abide by the law. Mr. Mrozek said Mr. Lynch had broken local and federal laws.

“Charles Lynch might be the last man to go to jail for medical marijuana,” Mr. Duncan said.

A Justice Department official said the situation of marijuana dispensary operators already in the criminal justice system would be decided case by case.

Mark Agrast, a senior fellow at the Center for American Progress, a liberal-leaning research group in Washington, said Mr. Holder’s statement indicated a more pragmatic and less ideological approach to drug enforcement.

“This is an example of recognizing the limited resources they have, so they have to make decisions about the soundest use of available resources,” Mr. Agrast said.