California just moved a step closer to becoming a “sanctuary state” where local and state police would not assist federal enforcement of marijuana laws.

The state Assembly approved a bill Thursday barring state and local law enforcement officers, absent a court order, from helping federal drug agents in arresting people who are complying with state laws allowing the use and sale of marijuana.

With a Friday deadline for action, the measure by Assemblyman Reggie Jones-Sawyer (D-Los Angeles) was sent to the state Senate for consideration.

The lawmaker argued his legislation was needed because the Trump administration had threatened to resume enforcement of federal law that considered marijuana an illegal drug.

Related: California vs. Trump: Bill would create sanctuary state for marijuana

Editorial: California should not become marijuana ‘sanctuary state’

In November, California voters legalized the sale and use of recreational marijuana by approving Proposition 64, two decades after medical use was approved by state voters. The state plans to begin issuing licenses to grow, transport and sell marijuana in January.

“AB 1578 ensures that our limited local and state resources are not spent on federal marijuana enforcement against individuals and entities that are in compliance with our laws,” Jones-Sawyer said during the floor debate.

With law enforcement opposed to the bill, the measure faced long odds and only achieved the bare majority 41-32 vote late Thursday night.

Also against the idea were Republican lawmakers, who said it would hamper the working relationship between California police officers and federal drug agents who might discover illegal activity involving marijuana sales even in a legal market.

“It would interfere with local and state agencies’ ability to cooperate with the federal government,” said Assemblyman James Gallagher (R-Yuba City). “This is bad policy.”

Assemblyman Travis Allen (R-Huntington Beach) said the Jones-Sawyer bill was similar to sanctuary-state legislation that would prohibit local law enforcement agencies from helping federal immigration agents arrest and detain people in the country illegally.

“This is insanity,” Allen told his colleagues. “This is a complete violation of federal law. The hubris of California Democrats believing they can flout federal law on immigration and drug policy is beyond words.”

He said local law enforcement would be put in “harm’s way” if there was no cooperation with federal drug enforcement officers.

Jones-Sawyer said he was open to revising the bill language to make it clear he wanted to allow cooperation between locals and federal agents in cases where state and federal marijuana laws were being violated. He said there were about 1,400 illegal marijuana businesses operating in Los Angeles that he wanted shut down.

Assemblyman Rob Bonta (D-Alameda), who co-wrote the bill, said the measure would reassure those who complied with California’s cannabis laws that they would not get in trouble.

“People who are compliant with California law and operate within the legal cannabis market should not have to fear that a state or local agency will participate in efforts to punish or incarcerate them for activity that the state and its voters have deemed legal,” Bonta said.

The Assembly on Thursday also approved a separate bill that merges rules from the medical marijuana laws with those from Proposition 64.

That bill, which also now goes to the Senate for consideration, allows medical cannabis facilities that are for-profit, bans pot billboards on interstate and state highways, requires state licenses after officials determine recreational-use businesses comply with local ordinances, and provides $3 million to the California Highway Patrol for developing drugged-driving enforcement plans.

© 2017 Los Angeles Times (Los Angeles, Calif.) Visit The Times at Distributed by Tribune Content Agency, LLC.

To subscribe to The Cannifornian’s email newsletter, click here.