The Obama administration said Thursday that it would not challenge laws legalizing marijuana in Colorado and Washington state as long as those states maintain strict rules involving the sale and distribution of the drug.

In a memo to U.S. attorneys in all 50 states, Deputy Attorney General James M. Cole said the Justice Department is “committed to using its limited investigative and prosecutorial resources to address the most significant threats in the most effective, consistent and rational way.” He stressed that marijuana remains illegal under federal law.

The memo, which was welcomed by proponents of marijuana legalization, directs federal prosecutors to focus on eight areas of enforcement rather than spending time targeting individual users. Those aims include preventing distribution of marijuana to minors, stopping the growing of marijuana on public land, keeping pot from falling into the hands of cartels and gangs, and preventing the diversion of marijuana to states where it remains illegal.

Attorney General Eric H. Holder Jr. called the governors of Colorado and Washington about noon Thursday to inform them of the decision. A Justice official said Holder told them that federal prosecutors would be watching closely as the two states finalize a regulatory framework for marijuana and that prosecutors would be taking a “trust but verify” approach.

Last fall, Washington and Colorado approved initiatives to legalize the possession of less than an ounce of marijuana, becoming the first states to approve the drug for recreational use. Twenty states and the District have passed laws legalizing marijuana for medicinal purposes.

Irv Rosenfeld has received shipments of marijuana cigarettes from the federal government for more than 30 years. They’ve eased the impact of his rare illness and created some awkward moments at airport security. (The Fold/The Washington Post)

Until Thursday, the administration had remained silent about the initiatives in Colorado and Washington, despite requests for guidance from state officials.

“We recognize how difficult this issue has been for the Department of Justice and we appreciate the thoughtful approach it has taken,” Colorado Gov. John Hickenlooper (D), who opposed efforts to legalize marijuana last year, said in a statement. “Amendment 64 put Colorado in conflict with federal law. Today’s announcement shows the federal government is respecting the will of Colorado voters.”

Washington Gov. Jay Inslee (D), in a statement with state Attorney General Bob Ferguson, said the guidance “reflects a balanced approach by the federal government that respects the states’ interests in implementing these laws and recognizes the federal government’s role in fighting illegal drugs and criminal activity.”

Proponents of marijuana legalization welcomed the new administration guidance.

“This is a very significant step forward,” said Christian Sederberg, a Denver lawyer who helped draft Amendment 64. “The simple truth is that a tightly regulated marijuana market is superior to the criminal market. ­State-regulated business will now be able to continue creating good jobs and generating tax revenue. This is what progress looks like.”

Sederberg said state lawmakers and a government-backed task force in Colorado have tried to deal with the concerns of federal officials — such as keeping pot out of the hands of minors — while setting up the regulatory framework for a marijuana market.

Sam Kamin, a University of Denver law professor and a member of the governor’s task force that helped devise Colorado’s forthcoming marijuana regulations, said Thursday’s memo represents a “big change of direction for the federal government” but one that was overdue.

“Marijuana exists in this strange place where a number of states permit it but the federal government prohibits it. For a long time, it’s been pretty untenable,” Kamin said. “For the first time . . . they’re saying that if you can do a good job with it, we will not come in with the hammer of federal enforcement.”

But he said questions remain.

The guidance steers clear of whether major banks — which have been wary of giving credit to marijuana-related businesses — can now do so without fear of legal consequences. Because marijuana remains illegal under federal law, it also means individuals still risk losing their jobs, apartments, even custody of children if they are found using a drug that is legal on the state level.

Perhaps most significant, Kamin noted, Thursday’s action represents the views of one administration — and the next one might see things differently. “This could be wiped out with a stroke of a pen,” he said.

Not everyone saw Thursday's action as a positive step.

“We can look forward to more drugged driving accidents, more school drop-outs, and poorer health outcomes as a new Big Marijuana industry targeting kids and minorities emerges to fuel the flames," Patrick Kennedy, co-founder of Project SAM (Smart Approaches to Marijuana), said in a statement. The group opposes marijuana legalization.

The Obama administration has long wrestled with how to respond to state laws permitting marijuana use for one reason or another.

In 2009, then-Deputy Attorney General David W. Ogden wrote a memo to U.S. attorneys saying that prosecution of significant traffickers of illegal drugs, including marijuana, remained a top priority. But he also said that the prosecution of individuals using the drug for medicinal purposes in compliance with state law “is unlikely to be an efficient use of limited federal resources.” In 2011, Cole reiterated Ogden’s stance on medical marijuana but cited the increase in large-scale commercial marijuana operations “for purported medical purposes.”

In December, Obama told Barbara Walters of ABC News that recreational marijuana use in states that have legalized the drug was not a major concern.

“We’ve got bigger fish to fry,” he said.

Thursday’s memo, while significant, makes clear that the federal government reserves the right to revisit its position in the future.

Sari Horwitz contributed to this report.