High demand for Hormel Foods Corp.’s array of protein products — bacon and turkey burgers, anyone? — propelled the company’s third-quarter earnings comfortably above investors’ expectations.

Austin, Minn.-based Hormel, maker of everything from Spam to turkey sausages, managed to post strong profit growth at a time when other packaged food companies are muddling along.

And the company did so despite fears that a U.S. pork supply constriction — the result of a virus plaguing the nation’s hog farms — could gum up its profits.

“It was a pretty good quarter for them,” said Joe Agnese, a stock analyst at S&P Capital IQ. “The impact of the hog virus was less than expected. And there is strong consumer demand for protein.”

The virus, called porcine epidemic diarrhea, has been sweeping through the nation’s farms this year, killing piglets at an alarming rate. While it poses no threat to human health, the virus has threatened to pinch hog supplies, sending prices soaring.

Yet Hormel was able to offset any higher hog prices by essentially raising prices on its bevy of branded pork products at a time when consumer demand is high, said Brian Yarbrough, a stock analyst at Edward Jones. Protein-rich diets are “definitely in, and that’s helping Hormel,” he said.

For the three months ended July 27, Hormel earned $138 million, up 21 percent from a year ago. The profit amounted to 51 cents a share, 3 cents above the forecast of analysts polled by Thomson Reuters. Revenue was $2.28 billion, up 5.8 percent from a year ago.

“This was a solid quarter compared to what a lot of other food companies are posting,” Yarbrough said. “The General Mills, the Kraft Foods, the Kelloggs of the world are struggling.”

Hormel’s stock closed Thursday at $49.92, up $2.06, or 4.3 percent.

Profit doubled at Hormel’s biggest business line, refrigerated meats, which includes hams, bacon and other pork products. Hormel’s Jennie-O turkey business also fared well in the latest period, its operating profits growing 42 percent. Turkey demand has also been high, while turkey feed expenses — a key input cost — have been declining.

“Lower feed costs and higher turkey [selling] prices has really been working out well for them,” Yarbrough said.

However, Hormel’s grocery products unit, which includes Spam, canned chili and Compleats microwaveable meals, took a hit during the quarter. Its operating profits dropped 36 percent. Higher ingredient costs were a key problem.

Jeffrey Ettinger, Hormel’s chief executive, said cost pressures in the grocery products business are likely to continue in Hormel’s fiscal fourth quarter. Pork operating profits margins are not expected to be as flush in the fourth quarter, though continuing low feed costs will strengthen Hormel’s turkey operations.

“We expect to finish fiscal 2014 within our previously stated [profit] guidance range of $2.17 to $2.27 per share,” Ettinger said in a press statement.