SACRAMENTO — A federal judge in California declined Wednesday to remove marijuana from the list of most dangerous drugs, disappointing activists who saw the case as a chance to get closer to their goal of nationwide legalization.

U.S. District Judge Kimberly Mueller said during a brief court hearing that she was initially prepared to rule that marijuana should not be a Schedule 1 drug but then decided it was up to Congress to change the law if it wishes.

“It has been 45 years since Congress passed the Controlled Substances Act,” Mueller said, noting “the landscape has changed” since then.

However, the judge pointed out that courts are not designed to act as a maker of public policy and explained that she had made her decision based on the facts of the marijuana growing case that sparked the legal challenge.

“This is not the court and this is not the time” to overturn federal law, she said.

The ruling came after more than 20 states legalized medical marijuana use, and voters in four — Colorado, Washington, Oregon and Alaska — allowed recreational pot use. An effort is underway to legalize recreational marijuana in California as well.

A decision by Mueller to reject marijuana’s classification would have applied narrowly to the case she is hearing and likely would have been appealed. Still, it would have set a precedent for other criminal prosecutions and added to the growing push to change federal drug law, experts and advocates said.

The classification of pot as one of the most dangerous drugs has pitted federal authorities against states that have legalized medical marijuana and prompted raids on growers and dispensaries that appear to be operating legally under state law.

A ruling against marijuana’s classification “would have been significant because you would have had a federal judge acknowledging what a majority of the public has already concluded: That marijuana does not meet the three criteria of a Schedule 1 drug,” said Paul Armentano, deputy director of the National Organization for the Reform of Marijuana Laws.

Armentano, who helped the defense, said he has always believed the issue would have to be decided by a federal appellate court. He expects the case being heard by Mueller to be appealed.

Legal experts said Mueller’s decision to hold a fact-finding hearing last year that included expert testimony marked the first time in decades that a federal district court judge seriously considered marijuana’s classification on constitutional grounds. Judges have generally accepted the classification and the federal ban on its use, growth and distribution.

Alex Kreit, a drug law expert at Thomas Jefferson School of Law in San Diego, called the hearing a “sign that at least some judges are increasingly skeptical of marijuana’s status under federal law” and said it would influence marijuana policy despite the outcome.

The ruling came in a case alleging that marijuana was being grown in a remote area of Northern California. Attorneys for the defendants had sought to dismiss the charges on the grounds that pot should not be listed among Schedule 1 drugs, which include heroin and LSD and are defined as drugs with no accepted medical use and a high potential for abuse.

Defense attorneys argued that marijuana is far less harmful than some legal drugs, and its classification as a Schedule 1 drug was arbitrary in violation of the Constitution.

Defense attorney Bill Bonham, speaking for his fellow attorneys, said he was disappointed.

“I felt that the judge was leaning to grant the motion from our previous hearings,” he said.

Mueller plans to issue a written ruling and gave defense attorneys three weeks to regroup before a May 6 hearing to set a trial date.

In a statement after Mueller’s decision, prosecutors characterized the defense motion as an attack on the federal Controlled Substances Act, which created the five-tiered drug classification system.

Prosecutors had argued that marijuana met all the criteria for a Schedule 1 drug, saying it had no accepted medical use and a high potential for abuse. They also argued that Mueller did not have jurisdiction to consider how marijuana was classified.

The criminal complaint filed in 2011 accused 16 defendants of conspiring to grow at least 1,000 pot plants as part of an operation that included land in the Shasta-Trinity National Forest in California. Several defendants have settled their cases, leaving nine to face trial.