The federal government's ongoing war on weed just took another serious hit.

A new provision buried in the $1 trillion "cromnibus" spending bill will bring an end to federal crackdowns on the medical marijuana trade in states where it's been legalized, allowing dispensary operators and weed farmers to emerge from the omnipresent threat of Drug Enforcement Administration raids.

It's a major victory for anyone who believes that states should have the right to implement their own medical marijuana programs, and a major blow to the anti-marijuana movement. Smell the Truth reports:

... the U.S. House of Representatives approved a measure late Thursday night to de-fund the federal war on medical marijuana. The provision passed the Senate Saturday and is expected to be signed by President Obama, bringing a halt to the three-year-long medi-pot crackdown in California and other states.

The background: The law is only temporary and will last through Sept. 30. However, polls have repeatedly demonstrated widespread approval for medical marijuana, so the new legislation is sure to enjoy popular support. According to NORML, six of 10 Americans support letting states decide their own marijuana laws while about half openly support full legalization. In states like New York, support for legal medical marijuana at the state level is nearly 90%.

In a statement, co-author Rep. Sam Farr (D-Calif.) described the bill's passage as a win for medical marijuana.

This is great news for medical marijuana patients all across the country. The public has made it clear that they want common sense drug policies ... This amendment protects patients while the federal government catches up with the views of the American people. Patients will have access to the care legal in their state without fear of federal prosecution. And our federal dollars will be spent more wisely on fighting actual crimes and not wasted going after patients.

"For the first time, Congress is letting states set their own medical marijuana and hemp policies, a huge step forward for sensible drug policy," added Drug Policy Alliance national affairs director Bill Piper. "States will continue to reform their marijuana laws and Congress will be forced to accommodate them. It's not a question of if, but when, federal marijuana prohibition will be repealed."

Unfortunately, there's a downside. Rep. Andy Harris (R-Md.) inserted another provision to the spending bill designed to prevent Washington, D.C., from carrying out its planned marijuana legalization program, which passed with overwhelming approval in a November election. Harris' addition to the bill restricts federal funds from being used to "enact or carry out any law, rule, or regulation to legalize or otherwise reduce penalties associated with the possession, use, or distribution of any schedule I substance." In other words, making any more changes to marijuana legislation could become very difficult, if not impossible.

Since the DEA steadfastly refuses to reclassify marijuana, the provision puts the whole enterprise in jeopardy. However, Harris' amendment has some loopholes, such as the ability for the D.C. council to fund the legalization experiment using reserve funds, the same way the district paid its bills during the 2013 government shutdown.

"My job is to uphold the will of the voters, and the voters overwhelmingly support legalizing marijuana in the district," Mayor-elect Muriel Bowser told the Washington Post. According to Smell the Truth, activists from the district are already planning to sue over the new restrictions. So perhaps the Harris rider will go away, and marijuana reform activists can count this spending bill as an unblemished victory.