After losing about half of their value during 2015, shares of Spirit Airlines (SAVE) have rallied periodically since the beginning of 2016. However, each time, the company has encountered a setback -- whether due to an uptick in competition, labor unrest, or some other disruption. As a result, each time, Spirit Airlines stock has fallen back below the $40 mark.

Barely more than a week ago, shares of the discount airline were hovering around $45, but they have fallen 17% since then to close at $37.19 on Tuesday. Broader market turbulence played a role in this decline, as did rising fuel prices and a recent guidance cut at Southwest Airlines (LUV -0.84%).

SAVE Chart

Spirit Airlines Stock Performance. Data source: YCharts.

However, none of these factors can justify the extent of the recent sell-off in Spirit Airlines stock. Indeed, this looks like a great opportunity for long-term investors to jump in.

Spirit Airlines has been getting back on track

During the past two years or so, Spirit Airlines has faced two main challenges. First, rivals are competing more aggressively, matching Spirit's rock-bottom prices in many cases. Second, Spirit Airlines' pilots became increasingly militant as they attempted to secure big pay increases. This culminated in a damaging spike in flight cancellations last May.

Fortunately, Spirit Airlines has made substantial progress on both fronts recently. Revenue per available seat mile (RASM) fell just 1.8% year over year in the fourth quarter of 2017, which was far better than Spirit's 6.3% RASM decline a quarter earlier. Spirit's most recent guidance calls for revenue trends to remain relatively consistent with last quarter's result in the first quarter of 2018, with RASM down 1%-2.5% year over year.

Just as importantly, Spirit has resolved its pilot dispute at an acceptable cost. Last month, the pilots ratified a new contract that includes immediate raises of 43%. Despite these massive pay hikes, Spirit Airlines expects its non-fuel unit costs to decrease 0%-1% this year.

Is there any news that should worry investors?

With its labor problems resolved, Spirit Airlines should be in good shape to capitalize on the easy comparisons it faces in each of the next two quarters. (Unit costs skyrocketed in the second quarter of 2017 due to the pilot dispute, while unit revenue plummeted due to a fare war in the third quarter, as noted above.) However, the recent plunge in Spirit's stock price suggests that investors think something has changed for the worse.

A yellow Spirit Airlines plane parked at an airport gate.

Investors seem to be worried about Spirit Airlines' trajectory. Image source: Spirit Airlines.

The evidence points the other way. Oil prices have ticked up in the past couple of weeks, but only by the equivalent of about $0.10/gallon. That's not a particularly significant change. Meanwhile, concerns about a potential trade war aren't very relevant to Spirit Airlines, which primarily serves the domestic leisure market.

At first glance, Southwest Airlines' recent guidance cut might seem more troubling. Southwest had initially expected RASM to rise 1%-2% this quarter. Last week, the carrier acknowledged in an SEC filing that it now expects RASM to be roughly flat year over year.

However, earlier this month, several other airlines increased their first quarter RASM outlooks. Most notably, JetBlue Airways -- which like Spirit Airlines mainly flies on the East Coast, with a particular focus on routes to and from Florida -- bumped up its Q1 revenue guidance. For comparison, only two of Southwest Airlines' top 10 markets are on the East Coast. This suggests that JetBlue may be the better indicator of Spirit's likely performance.

Spirit Airlines stock is dirt cheap

Following the recent sell-off, Spirit Airlines stock now trades for less than 11 times the average 2018 analyst earnings estimate. That seems extremely low, considering the company's massive growth prospects. Indeed, analysts expect earnings per share to surge 25% next year.

To be fair, analysts' estimates cannot be very precise for a company like Spirit Airlines. Changes in fuel prices, the competitive environment, or overall travel demand can all have a significant impact on earnings.

However, from a broader perspective, Spirit Airlines' rock-bottom cost structure and its stable base of non-ticket revenue are tremendous competitive advantages that will pave the way for long-term success. As a result, Spirit Airlines stock looks like a great bargain below $40.