The Senate Appropriations Committee on Thursday approved a budget amendment that would prevent the Department of Justice from cracking down on state-legal medical marijuana—likely to the consternation of Attorney General Jeff Sessions.

The amendment prevents the Department of Justice from using any of its funds to prevent states from “implementing a law that authorizes the use, distribution, possession, or cultivation of medical marijuana.” It was added by a voice vote to the 2018 Commerce, Justice, and Science appropriations bill.

The amendment is similar to the Rohrabacher-Farr amendment, which was present in an appropriations bill covering fiscal 2017 and has been around for years. Rep. Dana Rohrabacher (R-Calif.) is also moving a similar amendment through the House.

The efforts fly in the face of Sessions, who personally wrote to Congressional leaders earlier this year asking them to ditch such provisions for legislation covering fiscal year 2018. He argued that the DOJ must have full power to assert federal law and combat “dangerous drug traffickers who threaten American lives.” In earlier statements on the issue, Sessions had proclaimed that "good people don’t smoke marijuana."

But Senators clearly disagreed with his stance. “The federal government can't investigate everything and shouldn’t, and I don’t want them pursuing medical marijuana patients who are following state law,” Sen. Patrick Leahy (D-Vt.), who offered the amendment, told The Hill. “We have more important things for the Department of Justice to do than tracking down doctors or epileptics using medical marijuana legally in their state."

Senators were not in complete agreement. For instance, Sen. Richard Shelby (R-Ala.), said he supports states right but argued that the budget provision wasn’t the proper channel for the issue. “If Congress wants to tell the Department of Justice to stop enforcing the medical marijuana laws, then it should change the authorization within the Judiciary Committee, not through an appropriations provision,” he said.

But other lawmakers weren’t concerned by the objection—or worried about Sessions’ objections. Rohrabacher told The Hill he hopes to avoid a fight about it, but if there is one, “clearly we will win,” he said.

“The number of states that are legalizing at least the medical use of cannabis is overwhelming now. Public opinion has always spoken on this issue,” Rohrabacher said. “I think people will listen to their own constituents rather than Sessions.”