HERSHEY, Pa. (AP) — Hershey Co. shares melted Thursday after the company missed Wall Street’s profit forecast and struggled with rising costs.

But analysts said a 2.5-percent price increase announced in June should help the company deal with higher wages and transportation costs.

Hershey reported a third-quarter profit of $263.7 million, down 3.5 percent from the July-September period a year ago. Revenue was up 2.3 percent to $2.08 billion for the quarter, meeting analysts’ expectations.

But higher costs and lower prices caused Hershey’s earnings to come in lower than expected. The Hershey, Pennsylvania, company earned $1.55 per share adjusted for non-recurring costs, including charges related to its recent acquisition of Skinny Pop maker Amplify. Analysts surveyed by Zacks Investment Research expected earnings of $1.56 per share.

Hershey shares fell 5 percent to $102.34 in morning trading.

Hershey announced in June that it would raise prices by an average of 2.5 percent across the board for its products, which include Reese’s Cups and Twizzlers. But the company said much of the impact won’t be felt until 2019 because of customer promotions that are already in place.

Bernstein analyst Alexia Howard said in a note to investors that the price increase “is clearly one of the factors that should enable the company to hit better gross margin trends going into 2019, in combination with the company’s continuous improvement program.”

Hershey said it expects full-year net sales to increase toward the low end of its previously announced range of 3.5 percent to 5.5 percent. But it reaffirmed that its adjusted earnings will be in the range of $5.33 to $5.43 per share.