Hershey's shares fell as much as 2.3 percent to a near two-year low of $91.40 (65.6 pounds).

Hershey, like other U.S. food companies, has faced higher freight costs, as a dearth of drivers, new regulations and higher diesel prices make it expensive for haulers to transport products to stores.

At the same time, prices of its key commodity, cocoa, are touching new highs after rising 47 percent this year.

Hershey said on Thursday that full-year adjusted gross margins would decline 125 basis points. It had earlier anticipated flat gross margins.

Hershey in its post-earnings call said it does not see a lot of relief on some of the cocoa and other inflationary pressures.

A shorter Easter period this year is expected to result in sales at the low end of a prior 5-7 percent growth forecast, the maker of Kisses chocolates and Reese's Peanut Butter Cups said.

Cheerios cereal maker General Mills Inc in March also blamed higher commodity costs for a cut to its full-year profit forecast.

"(Hershey's) gross margin and FY18 guide-down confirms fears of freight-induced profit pressure and offsets from cost savings and (lower) tax rate are cosmetic fixes," Wells Fargo analyst John Baumgartner wrote in a note.

Adjusted gross margins fell to 44.9 percent in the first quarter, from 47.5 percent a year ago.

Excluding certain items, Hershey posted a profit of $1.41 per share, 1 cent above analysts' average estimate, according to Thomson Reuters I/B/E/S.

Revenue rose 4.9 percent to $1.97 billion, beating the average analyst estimate of $1.94 billion.

Sales in North America, the company's biggest market, rose 4.4 percent to $1.75 billion, mainly helped by its acquisition of Skinny popcorn maker Amplify Snack Brands.

(Reporting by Vibhuti Sharma in Bengaluru, additional reporting by Nigel Hunt in Chicago; Editing by Saumyadeb Chakrabarty and Maju Samuel)

By Vibhuti Sharma