New York (CNN Business) WestJet, Canada's second largest airline, has agreed to be purchased by Canadian private equity firm Onex in a $5 billion deal.

WestJet WJAFF Southwest Airlines LUV Air Canada ACDVF has long been considered theof Canada. Like Southwest, the 23-year old WestJet offers lower fares than its rivals and originally flew an all-737 fleet. That has pressured Canada's No. 1 airline,, and US airlines serving Canada to keep fares in check.

WestJet's 737 Max planes have been grounded for two months.

Boeing BA In recent years WestJet has become a more full-service airline, with business and first-class seats. And it has purchased longer-rangejets, such as the 787 Dreamliner, to expand into more overseas markets. But it also started Swoop, an ultra-low cost airline similar to Ryanair or US carrier Spirit, which have very low base fares but charge passengers for all manner of extras.

WestJet still primarily uses 737 jets in its fleet of nearly 200 planes, including the 737 Max. When the planes were grounded in mid-March, it hurt WestJet more than many other carriers: About 8% of its fleet has been grounded. The company stopped providing earnings guidance for the rest of the year, which depressed its share price.

WestJet said it received the offer from Onex in March and has been studying it since then. Although some privately-held airlines exist, such as Virgin Atlantic, it is relatively rare for an airline to be taken private by private equity investors.

Read More