The high cost of avocados this summer was a drag on profits for Hormel Foods Corp.

That’s right, avocados.

The Austin, Minn.-based protein powerhouse contended with African swine fever in Asia and trade issues. Its Skippy peanut butter took a hit when J.M. Smucker Co.’s Jif lowered prices. And sales fell again in its Jennie-O Turkey Store line.

But it was avocados, a favorite of health conscious consumers and avocado-toast aficionados, that played a surprisingly outsized role in Hormel’s quarterly profit decline of 5%.

Investors had low expectations for Hormel’s fiscal third quarter ended July 28 as the company also faced a higher tax rate. The final result beat investors’ expectations on a per-share basis and executives were upbeat about the coming months. Hormel shares jumped nearly 5% in Thursday’s trading.

“While our team continues to navigate near-term uncertainty, I remain very certain in their ability to deliver our key results and finish 2019 in a very strong manner,” Jim Snee, Hormel’s chief executive, told analysts and investors during a conference call.

Hormel earned $199.4 million, or 37 cents a share. Revenue was $2.3 billion.

Known historically as one of the nation’s leading pork producers, Hormel today also buys a large number of avocados to make products like Wholly Guacamole and Herdez guacamole salsa.

California had a smaller- than-usual avocado harvest this year and global demand for the fruit was higher, sending prices up more than 100% during the quarter, said Jim Sheehan, Hormel’s chief financial officer. But executives are focused on Mexico’s upcoming harvest, slated to occur in the next few weeks, which is the primary avocado harvest of the year. Early indicators for Mexico’s crop are positive.

“Avocado prices are expected to decline through October, but remain above last year,” Sheehan said. “We will have better visibility as the Mexican crop is harvested in the next few weeks.”

Avocado prices in retail have started to come down in recent weeks from the summer’s high of $2.10 each, set on July 5. As of Aug. 16, the national average retail price for a Hass avocado was $1.18, according to the U.S. Department of Agriculture.

The higher prices for those ingredients, along with lower sales of Skippy peanut butter, eroded profits in Hormel’s grocery-products segment.

Without naming the competitor, Snee said he was disappointed by Smucker’s move to lower Jif prices as consumer demand for peanut butter remains high. But he noted the rest of Hormel’s grocery products segment had a strong quarter.

Hormel’s largest business segment, refrigerated foods, managed to post its best-ever third quarter.

“Excellent results in refrigerated foods offset declines in [our] grocery segment,” Snee told analysts. “This was quite an accomplishment by the refrigerated-foods team.”

Hormel executives expect to grapple with a volatile pork market for the foreseeable future as the industry continues navigating the effects of African swine fever, which decimated much of China’s herd and is spreading.

Hormel executives, anticipating higher costs of raw whole hogs, raised prices in May on its pork-based products, like bacon, pepperoni and Spam, to offset those costs. But with trade wars and tariffs, global market uncertainty has made the effects of African swine fever hard to predict.

However, hog costs didn’t rise like Hormel predicted and its competitors kept prices below theirs. Hormel made corrections by lowering prices on many of its pork products during the quarter.

“We think they are managing [the volatility from African swine fever] the best they can,” said John Boylan, an Edward Jones analyst covering the food industry, who recommends a hold on Hormel stock. “With the disease spreading throughout a good portion of Asia and starting to hit Eastern Europe as well, pricing is really hard to predict at this point.”

In May, Hormel lowered its full-year guidance as it began feeling the effects of China’s African swine fever outbreak. Hormel reaffirmed that guidance Thursday.

The company’s Jennie-O Turkey Store brand continues to claw its way out of a multiyear oversupply in U.S. turkey and two product recalls last fall that resulted in a loss of distribution. Its operating profit fell just 9% in the latest quarter compared with a 45% decline in Hormel’s second quarter.