Gross margin fell 1.1 percentage points to 23.38 percent, Kroger said, with much of the decline due to lower margins for fuel sales.
Analysts have been closely watching Kroger's margins to see how well the company is able to pass on higher food costs to its customers.
The company estimated product cost inflation was 3 percent in the quarter, and said it had been able to raise its prices to compensate.
Kroger said profit was $253.8 million, or 37 cents a share, in the fiscal third quarter ended Nov. 10, up from $214.7 million, or 30 cents a share, a year earlier.
Analysts on average had expected 35 cents a share, according to Reuters Estimates.
Earnings were helped by the resolution of certain tax issues, which was mostly offset by lower margins from fuel operations and a decision to speed up spending on measures to improve its business.
Capital investment rose to $555.3 million from $415.0 million a year earlier.
Kroger has been remodeling stores and promoting items like fresh produce as it battles pressure from rivals ranging from Wal-Mart Stores, to dollar stores, to warehouse clubs and natural foods chains.
Sales rose 9.8 percent to $16.14 billion, beating analysts' average estimate of $15.68 billion. Sales at stores open five quarters without expansion or relocation rose 5.7 percent, excluding fuel sales.
Kroger said it expects full-year earnings to slightly exceed its previous forecast of $1.64 to $1.67 per share. Analysts' average forecast is $1.69, according to Reuters Estimates.
Kroger shares were down $1.77 to $26.57 in morning trade on the New York Stock Exchange. The shares are up 15 percent this year, compared with a 7 percent increase for the standard & Poor's 500 index.