Calgary-based WestJet has agreed to be acquired by Onex Corp. as part of a deal valued at $5 billion including debt. As part of the deal, WestJet will become a private company.

Onex will reportedly pay $31 per share, or about $3.5 billion.

The acquisition came as a surprise to many, including the head of the pilot union. Onex, a Toronto-based private equity firm, approached WestJet in March regarding the sale. There had been no indication that WestJet was for sale, nor that Onex was interested in buying.

Completion of the transaction will be subject to a number of conditions under business law, including regulatory, court and shareholder approvals. A special shareholders meeting is slated for July to vote on the transaction.

Clive Beddoe, WestJet founder, said in a news release that he was pleased the company’s headquarters will remain in Calgary.

“Onex’s aerospace experience, history of positive employee relations and long-term orientation makes it an ideal partner for WestJetters, and I am excited about our future,” said Beddoe.

The company’s board of directors has unanimously recommended that shareholders vote in favor of the deal at the special shareholders meeting.

WestJet first launched in 1996 as a low-cost domestic airline. Today, the company is an international carrier with flights to Europe, the U.S. and the Caribbean.

News of the sale comes after the carrier struggled in 2018. Increased competition, rising fuel costs and labor unrest caused the company to experience its first loss in 13 years during the second quarter of 2018. WestJet saw a significant year-over-year decline in the third quarter. The carrier has since bounced back.

The company’s current growth spurt may offset rising labor costs. WestJet’s 4,000 flight attendants have unionized over the last year. Labor peace would allow the company room for more growth.

But although Onex will be paying a 67% premium on the value of WestJet’s stock, it will be paying a 9% discount compared to the company’s stock price four years ago.

This isn’t the first time Onex has attempted to buy an airline. Two decades ago, the company teamed with AMR Corp., parent company of American Airlines, in a $1.8-billion bid to acquire and merge Canadian Airlines and Air Canada. A Quebec court ruled that the plan was illegal, so the plan came to a stop.

Onex also failed in its efforts to purchase Australia’s Qantas Airways Ltd. in 2007.

The deal is expected to close in late 2019 or early 2020.