What happened

President Trump has been a constant critic of oil prices, often tweeting that they're too high. Today, however, he's helping drive them up after his administration reversed course on Iran. That helped boost them by about 2.5%, with WTI (the U.S. oil benchmark) rising to more than $65.50 a barrel, while Brent (the global benchmark) moved up to almost $74 a barrel. Those are the highest levels for crude this year.

That uptick in oil prices fueled a sectorwide rally in oil stocks. Several smaller oil producers' shares surged double digits by the mid-afternoon, including Denbury Resources (DNR), Carrizo Oil & Gas (CRZO), and Extraction Oil & Gas (XOG). Meanwhile, many larger oil companies also saw gains, including Marathon Oil (MRO 0.36%) and Devon Energy (DVN 0.78%), which rallied about 5%.

Barrels of oil with a rising arrow and a bright light in the background.

Image source: Getty Images.

So what

The Trump administration provided an unexpected jolt to the oil market by ending the waivers granted to eight nations that allowed them to bypass U.S. sanctions on Iranian oil exports. That had allowed the country to ship 1 million barrels of oil per day (BPD). However, the Trump administration wants to see Iran's exports drop to zero, which is quite a decline considering that it was shipping 2.5 million BPD last year.

The U.S. said it's working with Saudi Arabia and the United Arab Emirates to ensure that the oil market remains well-supplied. However, that reassurance wasn't enough to calm fears that supply might fall short of demand -- especially since Iran warned that it would respond by cutting off exports from the Strait of Hormuz. That could significantly disrupt the flow of oil out of the Middle East.

This shift in policy will likely cause oil prices to continue rising, especially as demand for gasoline heats up during the summer driving season. Those higher oil prices would be a boon to smaller producers like Denbury, Carrizo, and Extraction. In Denbury's case, it was on track to produce between $50 million and $100 million in free cash flow this year assuming oil averaged $50 a barrel. It planned to use that money to continue chipping away at debt, which stood at $2.5 billion at the end of last year. Denbury's cash flow, however, will rise with oil prices. At $60 a barrel, it can produce between $125 million and $175 million in excess cash, which would help it to put a bigger dent in its debt load.

Carrizo Oil & Gas is in a similar situation. It ended last year with $900 million in debt and a leverage ratio of 2.4, which was above its 2.0 target. With oil prices on the upswing, the company is on track to achieve its free cash flow inflection point ahead of schedule, which will help it reach its leverage target sooner.

Extraction Oil & Gas, meanwhile, has a stronger financial profile since its leverage was right around its 1.5 times long-term goal. As a result, the company has been returning its excess cash to shareholders through a stock repurchase program. Extraction recently added $100 million to its plan and could buy back even more if oil continues rebounding.

Larger oil producers Devon and Marathon are in the same position as Extraction. Both have strong balance sheets and low-cost operations, so they're on track to produce a gusher of free cash at current oil prices. In Devon's case, it can haul in $2.3 billion in excess cash over the next three years if oil averages $60 a barrel. Marathon, meanwhile, can generate $2.2 billion over the next two years at that oil price. Both companies will likely return those windfalls to shareholders through additional share repurchases, which could give their stocks more fuel to continue rallying.

Now what

Oil crashed last fall after President Trump unexpectedly granted waivers to some of Iran's key customers. His reversal of that policy is helping extend crude's rebound, which had already enjoyed its best quarter in a decade. Those higher oil prices will help producers generate a gusher of cash flow this year that they can use to shore up their balance sheets or reward investors, which could give their stocks a further boost.