During his run for the US presidency last year, Obama said that he wanted to call a halt to raids of medical marijuana facilities operating legally under state laws.
The administration of George Bush, the previous US president, had argued that the federal law against marijuana trumped state laws.
A raid by the US Drug Enforcement Administration (DEA) on a medical marijuana facility in Lake Tahoe, California, had fuelled discussion as to whether Obama would follow up on his pledge.
However, a White House spokesman said that "federal resources should not be used to circumvent state laws", while Eric Holder, the US attorney-general, said he would follow Obama's position.
About a dozen states have adopted laws permitting the use of marijuana for medical puposes.
The justice department will prosecute people who use or distribute marijuana illegally under the guise of operations deemed legal, Holder said in a statement.
"It will not be a priority to use federal resources to prosecute patients with serious illnesses or their care givers who are complying with state laws on medical marijuana," Holder said.
"But we will not tolerate drug traffickers who hide behind claims of compliance with state law to mask activities that are clearly illegal."
Federal prosecutors remain ready to prosecute medical marijuana cases that involve unlawful use of firearms, violence, illegal sales to minors, money laundering or other violations of the law, a justice department official said.