Rising oil prices and spending cuts over the past two to three years have improved the cash flow position for many of the oil majors, lessening the prospects of a deeper debt spiral, credit downgrades and dividend reductions.

As recently as a few months ago, debt among the largest oil companies was rising at a worrying pace, with ExxonMobil – usually considered the most financially sound out of its peers – reported an eye-watering $46 billion of debt at the end of the third quarter in 2016. Exxon even lost its coveted AAA credit rating last year as ratings agencies warned about its growing leverage.

The other oil majors were not faring much better. Shell has a whopping $78 billion in debt, having borrowed heavily to finance its $50 billion purchase of BG Group. Chevron had $45 billion in debt at the end of the third quarter. All told, the five “supermajors” have doubled their collective debt to $220 billion since 2014, according to Bloomberg.

But they could finally be turning a corner. According to analysts with Jefferies International Ltd., the oil majors can now meet spending levels and dividends with their cash flow, meaning that they no longer have to take on more debt. For example, French oil giant Total is expected to report positive cash flow of $1 billion in 2017 if oil prices average $55 per barrel. “As a group they are at peak debt levels now,” Jason Gammel, an analyst at Jefferies. Cuts in spending, layoffs, the shelving of high-cost oil projects and enhanced drilling efficiencies have contributed to an improved financial picture. Related: Expect A New Shale Boom This Spring

Fourth quarter earnings reports will be revealed in the next few days, and Bloomberg estimates that at least three of the oil majors will post an increase in year-on-year profits for the first time since 2014.

It is difficult to overstate the significance of this development for the oil majors. The closing vice of debt on the dividend policies of the oil majors was becoming difficult for many of them to bear. Oil executives view their payouts to shareholders as untouchable, and as such, management tends to cut everywhere else – spending, personnel, new drilling, selling off existing assets – in order to avoid raising the ire of Wall Street by slashing the dividend. But had oil prices continued to wallow away in sub-$50 territory, the day of reckoning would have arrived sooner or later.

But OPEC came to the rescue in late November. Since then, oil has reliably traded above $50 per barrel, pushing the largest companies out of the danger zone. Now, investors are no longer worried that the dividends will get reduced, at least not anytime soon.

That bodes well for the earnings reports next week. “We’ve had 2 1/2 years of doom and gloom and we are on the cusp of the upstream oil and gas sector entering a new recovery,” Tom Ellacott, a senior vice president at Wood Mackenzie, told Bloomberg. “We expect the mood music to be a bit more upbeat.” Related: Cash Strapped Iranian Oil Industry Braces For Trump Impact

The oil majors will respond to the sudden improvement in fortunes in different ways. BP is eyeing growth after years of contraction. Shell already tried to grow through the downturn, spending a hefty sum for BG Group. With exceptionally high debt levels – the second largest debt load out of any other oil company in the world aside from Petrobras – Shell is in no position to step up spending in any significant way.

ExxonMobil just made a splash in the Permian Basin, spending $5.6 billion earlier this month to double its acreage in the prolific shale play. Exxon has a tendency to arrive to the party late, spending more on acquisitions than some of its peers. The oil major spent more than $30 billion on XTO Energy in 2009, a deal widely seen as an expensive and late foray into the U.S. shale gas revolution. But as one of the largest publicly-traded oil companies in the world, it has money to throw around.

The financial improvement for the oil industry is not limited to just the majors. The IEA said in its December Oil Market Report that the U.S. shale industry as a whole became cash flow neutral in the third quarter of 2016 – for the first time ever. They added that higher oil prices will push many of the strongest shale companies well into profitable territory this year.

By Nick Cunningham of Oilprice.com

More Top Reads From Oilprice.com: