The grounding of the Boeing (NYSE:BA) 737 MAX has been extremely costly for a slew of airlines around the globe. As the largest operator of 737s in the world -- and the launch customer for the 737 MAX -- Southwest Airlines (NYSE:LUV) has experienced some of the biggest impacts. The carrier expected to have 75 737 MAX jets operating by the end of 2019, but it will instead have none, having canceled all 737 MAX flights through Feb. 8, 2020.

The resulting fleet shortage has already cost Southwest hundreds of millions of dollars, and the tally of damages keeps growing. However, Southwest Airlines has been able to overcome this obstacle and post strong earnings results throughout 2019. That trend continued last quarter.

Earnings growth despite a spike in nonfuel unit costs

Entering Q3, Southwest Airlines expected adjusted nonfuel unit costs to surge 9% to 11% in the quarter, driven almost entirely by the impact of the 737 MAX grounding. As Southwest's management has noted repeatedly this year, the company's costs are largely fixed once it sets its initial schedule for any period.

On the plus side, Southwest expected to achieve a solid 3% to 5% increase in revenue per available seat mile (RASM) in the third quarter. Additionally, it projected that fuel costs would decline to between $2.05 per gallon and $2.15 per gallon, down from $2.25 per gallon a year earlier, partially offsetting its nonfuel cost headwinds. Altogether, this forecast suggested that earnings per share would be roughly flat year over year in Q3.

Fortunately, Southwest Airlines reduced its nonfuel unit cost forecast by 1 percentage point last month. And on Thursday, the company reported that it beat its updated guidance, as adjusted nonfuel unit costs increased 7.6% for the quarter, largely due to lower-than-expected airport costs. Fuel costs also came in near the low end of the company's guidance range, at $2.07 per gallon.

A Southwest Airlines 737 MAX parked on a tarmac.

The Boeing 737 MAX grounding is putting pressure on Southwest's unit costs. Image source: Southwest Airlines.

Meanwhile, RASM increased 4.2% last quarter, edging in just ahead of the midpoint of Southwest's guidance. The net result was that the carrier's operating margin ticked up slightly on a year-over-year basis and EPS rose 14% to $1.23, blowing past the average analyst estimate of $1.08. Excluding a $0.05 benefit from favorable tax adjustments in the quarter, Southwest still would have posted a solid 9% EPS gain.

The Boeing 737 MAX grounding has hurt, but it's not all bad

Southwest Airlines estimates that the 737 MAX grounding reduced its operating income by about $210 million -- roughly 20% -- last quarter. The company expects another substantial impact in the fourth quarter, as the aircraft shortage will boost nonfuel unit costs by about 6 percentage points with no offsetting unit revenue benefit. Based on Southwest's guidance as a whole, EPS should be approximately flat year over year, compared to the strong growth the airline could have expected absent the Boeing 737 MAX issues.

That said, the 737 MAX grounding hasn't been quite as bad for shareholders as it might appear. First, Southwest will eventually receive substantial compensation from Boeing to offset its lost profits -- most likely in the form of discounts on future aircraft deliveries.

Second, the aircraft shortage has forced Southwest Airlines to make tough choices about which markets are working and which ones aren't. Most notably, the carrier will stop flying to Newark Airport in early November. Without the pressure from the 737 MAX grounding, Southwest might have postponed that necessary decision.

Third, with Boeing 737 MAX deliveries halted until at least December, Southwest has significantly reduced its annual capital expenditures estimate. That freed up cash for the company to buy back lots of stock at a meaningful discount to Southwest's all-time high share price of $66.29.

Earnings should fly higher in 2020 and 2021

There appears to be a decent chance that the 737 MAX will be officially ungrounded by the FAA at some point in December. It could take up to 40 days after regulatory approval for Southwest to be ready to put its 737 MAX fleet back into service. Southwest Airlines believes that it may start to receive some of the 41 737 MAX jets that were scheduled for delivery in 2019 just before year-end, with those deliveries likely continuing into the second quarter of 2020. It expects Boeing to catch up to its planned delivery schedule by the end of next year.

This would give Southwest Airlines 113 Boeing 737 MAX jets by the end of 2020, up from 34 now (none of which are operating, of course). The rapid growth of Southwest's 737 MAX fleet will lead to higher-than-normal capacity growth, driving down unit costs. It will also boost the airline's fuel efficiency.

Thus, these deliveries should enable Southwest to achieve strong earnings growth, mainly by removing the constraints on its capacity. However, the airline won't get the full benefit of the 737 MAX's return to service in the first half of 2020. As a result, some of the earnings growth will come in 2021.

Southwest Airlines stock currently trades for about 13 times earnings. Considering the company's strong balance sheet, substantial long-term growth opportunities, and the expected tailwind from getting back the 737 MAX, this looks like a bargain price.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.