Delta Air Lines is taking a $450 million loss because jet fuel prices didn't jump as much as the airline bet they would.

The Atlanta-based airline had locked in fuel purchases, in a contract known as a hedge, at levels above the current market value, betting that jet fuel prices prices would climb. And they did indeed rise. But they didn't go nearly as high as Delta had anticipated, which made that hedge a loser. So Delta pulled out of the fuel contracts, which cost the airline nearly half a billion dollars.

Shares of Delta (DAL) fell 4% in midday trading Tuesday.

Related: Delta making all in-flight entertainment free

But it's not all bad news for Delta. Fuel prices are up 60% from their January lows, but they're down 20% from a year ago. So, even with the cost of canceling its fuel contract, Delta will save money on fuel, which is its second largest expense, in the second quarter.

Delta took an even bigger hit on hedges last year -- $2.3 billion according to company filings -- as fuel prices fell throughout the year. It lost another $274 million on hedges in the first three months of this year.

Related: Delta aims for higher fares as fuel prices rebound

Delta is not the only airline to take a hit on fuel hedges. United Continental (UAL) lost $604 million last year. Southwest (LUV) said in a March SEC filing that it could lose more than $1 billion on its hedges in the coming years, after losing $254 million in 2015.P

Most carriers buy hedges to protect them from unexpected price spikes. American Airlines (AAL) is the only one out of the nation's four biggest carriers that doesn't do fuel hedges. Its executives are on the record as saying that they're a bad bet.