A few years ago, Delta Air Lines (NYSE:DAL) made an unorthodox move to buy an oil refinery that was on the verge of closing permanently. Delta was able to snag the refinery for just $150 million, plus an additional investment (estimated at $100 million) to refurbish the refinery and increase its jet fuel output.

The goal of this grand experiment was to hedge Delta's exposure to refining margins. While the price of oil is the biggest component of jet fuel prices, refining margins can sometimes add significantly to the cost. The only way to effectively hedge against that risk was for Delta to operate its own refinery.

Airline Delta Air Lines Dal Md

Delta bought a refinery in 2012 to improve its hedging capabilities. Photo: The Motley Fool.

But for the first year or so of its operation, the refinery's profitability fell well short of Delta's initial expectations -- leading to lots of "told you so" comments from analysts who had been skeptical of the project all along. Nevertheless, Delta's refinery purchase is finally paying off in a big way in 2015, validating the company's strategy.

High hopes and missed expectations
When Delta Air Lines announced the refinery purchase in April 2012, it claimed that the deal would reduce its fuel expense by about $300 million annually. These benefits were supposed to start accruing as soon as the fall of that year.

Yet Delta investors suffered a string of disappointments in late 2012 and early 2013, as everything from bad market conditions to bad weather caused the refinery to rack up losses. In total, the refinery posted a $63 million loss in 2012, followed by a $116 million loss in 2013.

However, the refinery got back on track in 2014, turning a $96 million profit that year. More than 100% of that annual profit came in the fourth quarter of 2014, when Delta's refinery segment posted a record quarterly profit of $105 million.

A great market for refiners
Delta's strong refinery profitability has continued into 2015, helping to offset some bad fuel hedging bets in the first half of the year. In Q1, the refinery earned $86 million. In Q2, it earned $90 million. This puts Delta on pace to exceed its initial target of $300 million in annual refinery earnings this year.

Moreover, conditions in the refinery industry have been getting better every day. The combination of cheap oil and solid demand for gasoline in the U.S. has driven up refining margins here. A few major unplanned outages have created shortages of refined products in certain regions, adding to refiners' windfalls.

Thus, while Delta's management projected in mid-July that the refinery's profit would subside to $60 million this quarter, the recent drop in crude oil prices could allow Delta to comfortably beat that target.

A savvy investment
The improved macro environment for refiners should allow Delta to meet, if not exceed, its $300 million annual refinery earnings projection in 2015. This also means that it will have reversed all of its cumulative losses from 2012 and 2013 and earned back nearly its entire initial investment by the end of the year.

In other words, Delta's refinery is doing exactly what it was supposed to do. It is allowing Delta to hedge against big swings in U.S. refining premiums while also contributing some incremental profit over time. Chalk it up as another win for Delta's farsighted management team.

Adam Levine-Weinberg has the following options: long January 2017 $40 calls on Delta Air Lines, The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.