President Trump avoided a government shutdown by signing a $1trillion spending bill, even though he disagrees with a provision safeguarding the use of medical marijuana.

The provision, known as the Rohrabacher-Blumenauer amendment, bars the Department of Justice from spending money that could interfere with 'the use, distribution, possession, or cultivation of medical marijuana'.

But in a signing statement that laid out his objections, Trump said he reserved the right to ignore the provision.

'I will treat this provision consistently with my constitutional responsibility to take care that the laws be faithfully executed,' Trump said in the signing statement, a tool that previous presidents have used to explain their positions on appropriations bills.

While medical marijuana is legal in 29 states, the District of Columbia, Guam, and Puerto Rico, marijuana - for any purpose - remains illegal under federal law.

Trump avoided a government shutdown by signing a $1trillion spending bill, even though he disagrees with a provision safeguarding the use of medical marijuana

The provision bars the Department of Justice from spending money to crack down on medical marijuana. Pictured, a growing facility in Denver, Colorado

The provision prevents the Justice Department from cracking down on medical marijuana. It does not apply to recreational marijuana, which was legalized in eight states in direct violation of federal law.

Despite signing off on the Rohrabacher-Blumenauer amendment, Trump held out the possibility that the administration could pursue legal action against states and territories that legalize marijuana for medical use.

Tom Angell, founder of the advocacy group Marijuana Majority, told Business Insider the statement is Trump's way of saying 'they reserve the right to do whatever they want and enforce prohibition regardless of the statutory prohibition on doing so.'

But in a signing statement that laid out his objections, Trump said he reserved the right to ignore the provision (pictured, a marijuana medical dispensary in Los Angeles)

The administration has so far sent mixed messages on the issue.

White House Press Secretary Sean Spicer said the president was sympathetic to people who use medical marijuana.

But US Attorney General Jeff Sessions has repeatedly voiced his opposition to legalization, saying 'good people don't smoke marijuana' during a Senate hearing in April 2016.

He also said: 'We need grown-ups in charge in Washington to say marijuana is not the kind of thing that ought to be legalized, it ought not to be minimized, that it’s in fact a very real danger.'

But in a meeting with Colorado Gov. John Hickenlooper this April, Jeff Sessions suggested that he would stick to a directive from the Obama administration that allowed marijuana businesses to continue operating in states where it was legal.

Sessions has repeatedly voiced his opposition to the legalization, saying 'good people don't smoke marijuana' during a Senate hearing in April 2016

While the provision leaves Sessions' hands tied, Trump's signing statement seems to throw that all into question.

Michael Collins, deputy director of the Drug Policy Alliance, urged the administration to clear up the confusion in a statement to Business Insider.

'After stating during the campaign that he was 100% in support of medical marijuana, he now issues a signing statement casting doubt on whether his Administration will adhere to a congressional rider that stops DOJ from going after medical marijuana programs,' Collins said.

'The uncertainty is deeply disconcerting for patients and providers, and we urge the Administration to clarify their intentions immediately,' Collins added.