Canopy Growth on Thursday announced it entered an agreement to purchase Acreage Holdings, a US pot company.

The groundbreaking, $3.4 billion deal would be the first example of a Canadian cannabis company buying up a US operator.

The deal will provide an opportunity for companies from consumer packaged goods, cannabis, and pharmaceutical industries to get exposure to the lucrative US market without violating federal law.

The Canadian marijuana behemoth Canopy Growth on Thursday morning announced it had entered into a conditional agreement to purchase Acreage Holdings, a US pot company, for $3.4 billion pending federal legalization in the US.

The deal sent a shockwave through the cannabis industry — and not just because of its size.

It's due to the complicated nature of the cannabis industry, in which the drug is fully legalized in Canada but not in the US. It was long thought by Canadian marijuana cultivators, known as licensed producers, that investing in US assets would be considered illegal — thereby putting their stock-exchange listing in jeopardy. Until this deal, Canadian marijuana producers like Canopy had generally avoided investing in the US even though that market is set to be much more lucrative.

"This would certainly be one of the most complex M&A transactions I've ever worked on," Jonathan Sherman, a partner at the law firm Cassels Brock, said in an interview. Sherman, along with the Cassels Brock partner Jamie Litchen, led Canopy's involvement on the deal.

"It's probably one of the most complex M&A transactions that's happened in the Canadian space for a long time," Sherman added.

Read more: 'My lips are wet, my mouth is watering to get a piece of that': A war is brewing between US and Canadian marijuana companies to claim a $75 billion market

Under current rules, neither the Toronto Stock Exchange nor the New York Stock Exchange, where Canopy is dual-listed, allows companies to violate US federal law by purchasing assets or investing in companies that sell THC-containing products to the US.

A representative for TMX Group, which owns the TSX, declined to comment.

Sherman said that the deal had been in the works for eight months and that regulators from both the NYSE and the TSX had been looped in to the discussions.

Inside Canopy Growth's Ontario marijuana cultivation facility. Canopy Growth

Business Insider previously reported that Canadian cannabis companies had been lobbying the TSX to change exchange regulations to allow them to purchase US assets.

Sherman pointed to Canopy's November investment in TerrAscend Corporation, a cannabis company with exposure to the US market, as providing a legally compliant framework for this type of deal.

Read more: Canadian marijuana companies are quietly pushing the Toronto Stock Exchange to allow them to invest in the lucrative US market, and it could be transformative for the $75 billion industry

"That kind of got the conversation going on what would end up being the structure of this transaction," Sherman said.

As part of the deal, Acreage shareholders — including John Boehner, the former Republican House speaker — will receive an immediate $300 million payment, pending approval by the Supreme Court of British Columbia as well as both Canopy and Acreage shareholders.

The rest of the money would come when the US federally legalizes marijuana. Or, as many Wall Street analysts have pointed out, if Congress passes something like the STATES Act — which would allow states to choose their own route on marijuana legalization, as many have already done — it would pave the way for banks to work with the industry.

That interim period was one of the main "sticking points" in the negotiations, Sherman said, and he declined to say which policy would allow the deal to close.

Sherman said that there wasn't really historical precedence for this type of deal and that the team had to get creative and "put a lot of time and energy" into the deal to structure it in a way that was legally permissible and beneficial to both companies.

Read more: Unilever is the latest consumer giant to break into the potentially $16 billion hemp and CBD space with a new line of deodorants

"When we were negotiating the transaction, we kind of had to pull from a bunch of different places — it's a little bit part M&A, part joint venture in the sense that you've got two companies coming together with separate management teams, separate boards, and remain distinct entities for some time," Sherman said.

The closest analogy Sherman could think of would be a pharmaceutical transaction that depends on a drug's approval by the Food and Drug Administration — a process that could take years.

What is clear, however, is how groundbreaking the structure of this deal is for corporations that want to get in on the US cannabis market.

"I think this is going to untap the market," Sherman said. "You're going to see some interest from alcohol, tobacco, and pharmaceutical companies that aren't in the space right now because of sensitivity to cannabis generally."

If you have a structure where you can legally acquire another entity, like a US cannabis operator, said Sherman, it will open up interest from companies from those other sectors that "we may not have seen as recently as yesterday."

"Canopy Growth kind of set the standard here and paved the way for these novel transactions to be something we see a bit more regularly," Sherman said.