What happened

Shares of Occidental Petroleum (OXY -0.02%) leaped 41.3% in June, according to data provided by S&P Global Market Intelligence. Several factors fueled that rally, including positives in the oil market, analyst upgrades, and moves the company made to address its large debt load.  

So what

Occidental's stock started June on a high note. Shares went ballistic on June 5th -- rocketing a record 33% -- after OPEC agreed to extend the initial reduction rate of its historic agreement until the end of July. That news helped push oil prices higher for the month, which fueled a rally in most oil stocks

An oil pump with the sun bursting behind it.

Image source: Getty Images.

Two other factors added fuel to Occidental's rally last month. First, the company made some notable progress in addressing its debt. It was able to raise $2 billion of new debt, which it intends on using to repurchase bonds that mature next year. While it paid a high price for this debt, it will provide some much-needed breathing room. Occidental Petroleum also made some progress on its asset sale plan, as it's close to finding a buyer for large land tracts in Wyoming and Colorado. 

These positives had analysts growing bullish on the company's prospects. Bank of America upgraded the stock to buy, stating that the worst was over. Meanwhile, Raymond James reiterated its strong buy rating, fueled by its belief that the company would generate lots of cash and be able to sell assets now that oil prices have improved. SunTrust also upgraded the stock to a buy last month on the view that it would produce lots of cash over the next year to help pay down debt.  

Now what

With oil market conditions improving, analysts and investors are starting to believe that Occidental Petroleum will survive. They think that the company can generate cash and sell assets to pay down its massive upcoming debt maturity wall. However, risks remain since it still has a lot of debt to address amid a very challenging oil price environment.