NEW YORK (Reuters) - Investors are worrying that rising energy costs due to an escalating conflict between the United States and Iran that has caused a spike in oil prices will hurt U.S. corporate earnings.

FILE PHOTO: The sun sets behind an oil pump outside Saint-Fiacre, near Paris, France September 17, 2019. REUTERS/Christian Hartmann

Oil prices briefly jumped to four-month highs overnight after Iran launched missiles at U.S.-led forces in Iraq, but retreated after signs that further military action may been limited. [O/R] Despite that pullback, oil prices remain nearly 25% higher over the last 12 months, due in part to rising tensions in the Middle East.

While the energy sector would benefit from higher oil prices, profit margins in other sectors ranging from shipping to manufacturing to restaurants would narrow as gasoline prices rise. Some investors said they were acting more defensively against this backdrop.

“Oil is still not prohibitively expensive, but it’s significantly more expensive than it was when companies were making their budgets a year ago,” said John LaForge, head of real asset strategy for Wells Fargo Investment Institute. “They might have the ability to pass it on or they might not, but overall there is going to be a hit to margins.”

At $67 a barrel LCOc1, the price of oil remains far below the level that would send the United States into an immediate recession. Yet higher energy costs at a time of heightened geopolitical risks are likely to leave investors and companies skittish, fund managers and analysts said.

The conflict between the United States and Iran escalated early on Wednesday with a retaliatory Iranian missile attack here&rlz=1C1GCEB_enUS868US868&oq=Trump+orders+drone+attack+Reuters&aqs=chrome..69i57j0l7.5824j0j4&sourceid=chrome&ie=UTF-8 on U.S.-led forces in Iraq for the U.S. killing of an Iranian general days earlier [nL1N29D006.]

Yet oil futures fell after tweets by U.S. President Donald Trump and Iran's foreign minister seemed to signal that further military action was not forthcoming. Trump had ordered a drone strike here on Friday that killed Iranian General Qassem Soleimani.

The benchmark S&P 500 index .SPX posted modest gains in midday trading on Wednesday.

First-quarter earnings of companies in the S&P 500 are expected to rise 6.2% from a year earlier, according to estimates from Refinitiv made before the recent jump in oil prices. Those estimates were largely based on assumptions that economic growth will rebound in 2020, though corporate earnings are expected to have fallen by 0.6% in the fourth quarter of 2019. Companies will begin reporting results next week.

WAKE-UP CALL

The likelihood that oil stays near current levels or moves higher will push more investors into a defensive crouch until it becomes clearer how companies are responding, said Barry James, a portfolio manager at James Investment Research.

“Stocks are not cheap and we’ve had this huge run-up and sentiment had gotten dangerously bullish,” he said. “I would want to have at least a moderate position in energy if I didn’t have any and some gold in my portfolio.”

The attacks should serve as a wake-up call to investors who piled into stocks during the S&P 500’s months-long rally, said Christopher Stanton, chief investment officer at San Diego-based Sunrise Capital LLC.

“We’ve had three months of asymmetric upward moves in the equity markets,” he said. “Things have become increasingly overbought. If you’re an investor, don’t you want to take it easy here and back off a bit?”

Still, oversupply in the global oil market and the emergence of the United States as the world’s top oil producer will likely keep oil below $75 a barrel. That is, as long as the conflict between the United States and Iran does not escalate to the point where Iran attempts to close the Strait of Hormuz, a chokepoint through which about a fifth of the world’s oil supply flows, LaForge said, as he put the price of oil in perspective.

“This is still a small move, historically speaking,” he said.