A bipartisan House -- led by a pair of Californians -- on Friday ordered the Justice Department to stop targeting medical pot clubs that comply with state law, marking a major shift in the way Congress views marijuana.

The 219-189 vote in the Republican-led House early Friday might eventually bring relief for some targeted California operations while emboldening other states to adopt marijuana legalization laws of their own -- if it can survive a difficult path in the Senate.

"It was a surprise vote, it was a welcome vote, and it has been 10 years in the making," Rep. Sam Farr, D-Carmel, said Friday of the amendment to the Justice Department's spending bill he co-authored with Rep. Dana Rohrabacher, R-Huntington Beach. "It really was with this new Republican surge that we were able to get over the top."

Federal Drug Enforcement Administration officers carry boxes of a pungent-smelling substance from We Are Hemp medical marijuana dispensary on East
Federal Drug Enforcement Administration officers carry boxes of a pungent-smelling substance from We Are Hemp medical marijuana dispensary on East Lewelling Boulevard on Wednesday, Oct. 8, 2008, in unincorporated Hayward, Calif. No arrests were made. (Jane Tyska/The Oakland Tribune) ( JANE TYSKA )

When this amendment was first offered in 2003 by Rep. Maurice Hinchey, D-N.Y., Rohrabacher was among very few Republicans who supported it. But on Friday, it won votes from 49 Republicans -- about twice as many as in 2012, the last time it was voted upon.

Rep. Steve Cohen, D-Tenn., said as time goes by, more House members are able to get past old propaganda about marijuana and make wiser assessments of its benefits and risks. "The times they are a-changin'," he quipped Friday.

California in 1996 was the first state to legalize medical marijuana; 21 states plus the District of Columbia have followed. But marijuana remains illegal under the federal Controlled Substances Act, and many facilities in these states have been subject to federal raids, warning letters to landlords or civil property seizure lawsuits.

The amendment approved Friday doesn't deal with recreational use of marijuana, which Colorado and Washington voters approved in 2012; federal agencies so far have not cracked down on those states' activities.

Rohrabacher issued a statement calling the vote "historic" and "a victory for states' rights, for the doctor-patient relationship, for compassion, for fiscal responsibility. This vote shows that House members really can listen to the American people, form coalitions and get things done."

The amendment was offered this year by six Democrats and six Republicans, including four from California: Farr, Rohrabacher, Barbara Lee, D-Oakland; and Tom McClintock, R-Granite Bay.

The amendment still must be adopted by the Senate and the bill must be signed into law by President Obama before it will have any effect. But Lee said Friday she hopes the Justice Department will see this as "a positive development" that brings clarity to what Congress wants.

Lee, whose district includes several medical marijuana facilities that have been threatened or raided by federal agencies in recent years, said she intends to make sure federal agents and prosecutors "comply with the will of the people."

"This is another tool to use to go after them, really, to tell them to stop it," she said. "Let's hope the Senate picks this up and carries the ball forward."

The news emboldened Steve DeAngelo, executive director of Oakland's Harborside Health Center. U.S. Attorney Melinda Haag, Northern California's top federal prosecutor, is waging a lawsuit to seize the Oakland and San Jose buildings that house Harborside.

DeAngelo said a wave of state laws and supportive public opinion polls in recent years foretold Friday's vote.

"It's time for our elected representatives to rein in the out-of-control federal drug bureaucracy. Those elected officials who fail to take action do so at their own peril," he said. "Contrary to myth, cannabis consumers have very good long-term memories and staying power."

But U.S. Sen. Dianne Feinstein said Friday that "if a similar amendment were offered in the Senate, I would strongly oppose it."

Feinstein, D-Calif., said she's sympathetic to legitimate patients' needs, but "rogue medical marijuana dispensaries, which require little or no medical bona fines and are prevalent throughout California, present major challenges for communities across the country."

Federal action has closed more than 400 such "rogue dispensaries" in California since 2012, she said, "but the House amendment would prevent these critical enforcement activities from continuing."

U.S. Sen. Barbara Boxer, D-Calif., offered qualified support but with similar qualms. "I strongly support cutting off funds that would shut down legal and licensed medical marijuana dispensaries, but I think funds should be available to go after rogue dispensaries that are not licensed or not abiding by state law."

Advocates like Bill Piper, the Drug Policy Alliance's national affairs director, hope Feinstein and Boxer will be in the minority. He called Friday's vote "an unprecedented change in course in the war on drugs ... a bipartisan consensus in Congress in favor of letting states set their own medical marijuana policies."

He and others also hope states that had balked at approving medical marijuana laws for fear of federal intervention and prosecution will now reconsider. Such a bill is now pending in the New York state Senate, for example.

Josh Richman covers politics. Contact him at 510-208-6428. Follow him at Twitter.com/josh_richman. Read the Political Blotter at IBAbuzz.com/politics.