What happened

Shares of Denbury Resources (NYSE:DNR) went on an epic ride in 2018, peaking at a gain of 199.1% in early October before nosediving to end the year. Overall, shares of the oil producer lost 22.6% for the year, according to data provided by S&P Global Market Intelligence. Here's what fueled Denbury's stunning run and excruciating collapse.

So what

Denbury got 2018 off to a good start by unveiling solid results for its Mission Canyon drilling program in Montana. Those successful tests increased the company's confidence that this region could be an important near-term growth driver. In addition, the company continued to shore up its balance sheet by using the free cash flow it was producing at higher oil prices to reduce debt. That improving financial position gave it the confidence to sanction a new major expansion project that should start producing oil by late 2021. This combination of positive catalysts and higher oil prices for much of the year ignited Denbury's stock.

A silhouette of an oil pump in an oil field at sunset.

Image source: Getty Images.

However, the company started running out of gas in early October as oil prices began selling off. Crude would go on to collapse 40% from its peak in October, putting it down 19% for the year, after the Trump administration agreed to allow most of Iran's key customers to continue buying its oil and bypassing the reimposed sanctions. That policy shift caused the oil market to go from tightly supplied to having more oil than it needed overnight.

That sell-off in the oil market couldn't have come at a worse time for Denbury Resources. That's because the company agreed to buy oil-focused driller Penn Virginia (NASDAQ:PVAC) for $1.7 billion toward the end of October. While Denbury saw the deal bolstering both its growth prospects and balance sheet, investors believe it was not only ill timed but the wrong acquisition to make, since Penn Virginia drills shale wells, while Denbury primarily uses carbon dioxide to enhance the recovery of oil from older conventional wells. Those concerns sent the company's stock plunging after it announced the transaction, which continued for the rest of the year as oil sold off.

Now what

Denbury Resources enters 2019 with lots of uncertainty. One of the company's largest investors is actively working to scuttle the deal with Penn Virginia, which leaves it in a bit of a "strategic limbo," according to analysts. While the transaction would boost the company's balance sheet and cash flow, there is lots of execution risk since these companies operate different types of assets. However, if Denbury removes this uncertainty and oil prices rebound, then shares could bounce back big-time in 2019. But if crude resumes its slide, Denbury's stock will likely follow.

Check out the latest Denbury Resources earnings call transcript.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.