Rep. Dana Rohrabacher said he hopes to convince Attorney General Jeff Sessions that good people do indeed sometimes smoke pot. But if he can’t, the Republican congressman from Costa Mesa said he’ll see his longtime friend in court.

“Marijuana laws in this country have violated every basic principle this country stands for over the last 75 years. It’s time to stop,” Rohrabacher said during a roundtable talk on cannabis at UC Irvine on Friday.

“If we have to take it all the way to the Supreme Court, we will win on this.”

Though 29 states have legalized medical marijuana and eight, including California, allow recreational cannabis, the drug remains illegal at the federal level.

Rep. Dana Rohrabacher, left, gets a tour of Bud and Bloom dispensary from Kyle Kazan, a partner and board member, in Santa Ana on Friday, May 5, 2017 during a “meet and greet” and Cinco de Mayo celebration at the dispensary. (Photo by Leonard Ortiz, Orange County Register/SCNG)

Rohrabacher — who has used cannabis himself to ease arthritis and visited the Bud and Bloom dispensary in Santa Ana on Friday night after his talk — has unexpectedly become a leading figure in the fight to change that.

He co-authored the Rohrabacher-Farr amendment, which has blocked the Department of Justice since 2014 from spending money on medical marijuana prosecutions in states where cannabis is legal. That amendment became even more crucial once President Donald Trump appointed Sessions, who has said “good people don’t smoke marijuana,” sparking concerns of a renewed federal crackdown on state-legal dispensaries.

The Rohrabacher-Farr amendment was set to expire but was included in an omnibus spending bill approved Thursday to fund the federal government through September.

“I had to work really hard to make sure it was in the omnibus bill,” Rohrabacher said. “I had to run around and talk to people and twist arms.”

He was celebrating the win Thursday. But as Trump signed that omnibus bill Friday, he indicated that he might ignore Congress and instead interfere with state medical marijuana programs after all.

Kyle Kazan, lett, a partner and board member of the Bud and Bloom dispensary poses for a photo with Rep. Dana Rohrabacher during a “meet and greet” event and and Cinco del Mayo celebration at the dispensary in Santa Ana on Friday, May 5, 2017. (Photo by Leonard Ortiz, Orange County Register/SCNG)

“It is nebulous, but nebulous doesn’t mean we’ve lost,” Rohrabacher said. “We have other forces at play — legal forces.”

He said he’s known Sessions since they were teenagers involved in conservative organizations. He said the attorney general is “an honest man and person who has got a good heart.” But he said Sessions is someone who “thinks he can help you along by telling you what to do with your personal life.”

Rohrabacher spoke with Sessions at the Capitol on Thursday, he said, and they made plans for an in-depth meeting on the cannabis issue.

He wouldn’t predict which way those talks will go. But he said if Sessions doesn’t come around and instead manages to convince Trump to go back on his campaign pledge to support medical marijuana and let state rights stand, then Rohrabacher is confident the courts will continue to back Congress’ right to determine how federal funds are spent.

“It would be a huge waste of his time and money, and why would he do that?” the congressman said.