Kroger Co posted higher-than-expected quarterly earnings on Thursday, suggesting it was holding its own amid heated competition from Wal-Mart Stores Inc and other grocery stores.

Shares of the largest U.S. supermarket chain rose 3.1 percent after it said sales trends in the current quarter remained on track with those seen in the quarter that ended in May.

Kroger shares gained 63 cents to $20.71 in midday trading and the company's results also lifted shares of rivals Safeway Inc and Supervalu Inc 1.4 percent and 5 percent, respectively.

Walmart has loudly advertised its rollback discounts aimed at enticing shoppers into its stores.

Kroger Chief Executive Officer David Dillon said heavily promoted specials at Walmart were not having a particularly large impact on his business and that every Kroger supermarket division had positive same-store sales in the latest quarter.

But analysts said Walmart, which sells more groceries than any other chain, may have more discounts up its sleeve.

It's wait and see, Janney Capital Markets analyst Jonathan Feeney said.

The first salvo in Walmart's war on grocery stores landed in November, when it cut the price of Thanksgiving turkeys. It followed up this spring with heavily advertised rollbacks on certain grocery items, like 24-packs of soda and HJ Heinz Co ketchup.

Grocery accounted for almost 50 percent of U.S. sales at Walmart last year. Many analysts see Walmart as Kroger's toughest rival and the biggest near-term threat to the overall supermarket industry.

We know it's disrupting, said Mushkin, who added that companies like Heinz and JM Smucker Co have mentioned that Walmart's actions are having an impact on their business.

Kroger has an opportunity to woo food manufacturers that stand to lose sales when rival brands are featured as temporary, fast-moving Walmart rollbacks, Jefferies & Co analyst Scott Mushkin said.

If you're not part of that (Walmart) promotional activity your brand just withers, Mushkin said.

PROFITS HOLD UP

The company, whose stores include Kroger, Ralphs, King Soopers, Fry's and Food 4 Less, said net profit for the first quarter that ended May 22, fell 14 percent to $373.7 million, or 58 cents a share. That topped analysts' average call for earnings of 54 cents a share, according to Thomson Reuters I/B/E/S.

It also backed its fiscal-year earnings forecast of $1.60 to $1.80 per share on identical-store sales growth of 2 percent to 3 percent, excluding gasoline sales.

We view these results as very respectable, considering that other operators have been reporting declines in store productivity, Morningstar analyst Michelle Chang said in a client note.

Cincinnati-based Kroger's sales, including fuel, increased 8.7 percent to $24.8 billion in the first quarter, beating analysts' estimates of $24.1 billion. Excluding gasoline, sales rose 3.1 percent.

Closely watched identical-supermarket sales -- at stores open without expansion or relocation for five full quarters -- increased 2.4 percent, excluding fuel.

Kroger CEO Dillon painted a picture of two very different shoppers. While some increased spending on discretionary items like specialty deli meats, higher-end wines and coffee from in-store Starbucks kiosks, he said others remained dependent on government-issued food stamps and continued to watch every penny.

In their race to offer the lowest prices to U.S. consumers made wary by high unemployment and a still weak economy, some supermarket chains have put store traffic ahead of profits. As a result, investors have kept a close eye on margins.

The latest push from Walmart arrived as a bruising price war among Kroger, Safeway and Supervalu was showing early signs of easing and some investors worried that Walmart could fuel another race to the bottom in terms of pricing.

Kroger's gross margin, including fuel, fell 168 basis points to 22.7 percent of sales in the first quarter. Excluding fuel, margins fell 77 basis points. Supermarket margins were down 71 basis points.

The Street should be pleased the gross margin spend wasn't materially worse, said Hapoalim Securities analyst Ajay Jain.

As of Wednesday, Kroger shares were down 2.2 percent so far this year. During the same time period, the Standard & Poor's Food Retail Index <.GSPRETF> was up 6 percent.

(Reporting by Lisa Baertlein in Los Angeles and Ben Klayman in Detroit, editing by Lisa Von Ahn and Maureen Bavdek)