CALGARY -- A deal to bring together two rival oil and gas companies is now legal, thanks to a ruling from the Alberta Court of Queen's Bench.

The decision, issued Wednesday, approved the Plan of Arrangement between Cenovus and Husky that was announced back in October.

The development follows another approval of the deal announced Tuesday, where Husky Energy Inc. shareholders agreed to the $3.8-billion all-share takeover bid.

Executives with Husky said the new company will be more competitive, profitable and sustainable.

Shortly after it was announced, Cenovus did admit thousands of workers would be laid off as a result of the merger.

Together, the companies currently have 8,600 employees and contractors, which means between 1,720 and 2,150 layoffs are planned.

The deal is expected to close in the first quarter of 2021.

(With files from The Canadian Press)