Two warring Canadian pot producers reached a $1.1 billion truce today, ending a two-month old hostile takeover battle that has made headlines in the lead up to the legalization of weed.

Saskatchewan’s CanniMed Therapeutics, the first licensed medical marijuana company in Canada agreed to a friendly takeover by Aurora Cannabis Inc., valued at over a billion dollars in cash and stock, making it the biggest deal in Canada’s cannabis industry yet.

According to the terms of Wednesday’s agreement, CanniMed shareholders will receive 3.4 Aurora shares, either entirely in stock, or a combination of cash and stock for each CanniMed share that they own.

Aurora’s stock price was down slightly in morning trading, while CanniMed stock was up almost 16 percent by noon. “This transaction clearly confirms that the company has been highly successful in becoming a preeminent global leader in the medical cannabis industry,” CanniMed CEO Brent Zettl said in a statement.

Zettl had previously rejected Aurora’s takeover bid, calling it a scheme to “entice shareholders with phantom value” for their CanniMed shares, based on an “inflated share price”. In fact, CanniMed filed complaints with the Consumer Affairs Authority of Saskatchewan and the Ontario Securities Commission on those grounds — both complaints were rejected by regulators in December.

Last week, a CanniMed shareholder meeting to vote on the Aurora bid and a related takeover of Newstrike Resources Inc. was postponed, sparking speculation that a deal was in the works. As part of today’s agreement with Aurora, CanniMed will agree to abandon its bid of Newstrike.

“We haven’t slept for several days, but I could not be more delighted with the outcome,” Aurora’s Chief Corporate Officer Cam Battley told VICE Money. “Look, the discussion was brokered by a CanniMed shareholder, and it ended up having the full support of CanniMed’s Board of Directors, including Brent Zettl.”

Zettl was contacted directly by VICE Money, but could not be reached for comment.

There have been a slew of deals in the cannabis space ahead of legalization lately, including the $245 million stake alcohol company Constellation Brands stumped in Canopy Growth Corporation last year. With the CanniMed in its portfolio, there is a strong chance Aurora will overtake Canopy as the biggest cannabis company in the world, in terms of market capitalization.

“This is by far the largest M&A transaction to occur in the cannabis space — so far,” said Russell Stanley, special situations analyst at Echelon Wealth Partners told the Financial Post.