NEW YORK (CNNMoney) - So much for Amazon and Walmart killing the grocery business.
Supermarket giant Kroger, which also owns Ralphs, Fry's and Harris Teeter, reported sales and earnings that topped forecasts thanks to discounts that lured back shoppers.
Shares of Kroger surged 12% Thursday morning on the news, making it the top performer in the S&P 500. But the stock is still down more than 20% so far this year.
That's because Kroger has been in a fierce battle with Amazon, which acquired Whole Foods earlier this year and immediately began to slash prices on food. Walmart has been a tough competitor, too, as it has stepped up its game in the grocery business.
Walmart recently acquired delivery startup Parcel. It's also running a test program in which customers can order groceries online and have them delivered by a driver who enters their home using a one-time code on a smart lock to put away groceries -- all while the customer watches on a security camera.
And Europe's supermarket kings Aldi and Lidi have also invaded American shores -- stealing customers in the process.
Deflation in the food business hadn't helped either. A drop in prices for many agricultural commodities has meant that Kroger and big food suppliers like Campbell Soup, ConAgra and Kraft Heinz have had to cut prices. That's hurt profit margins.
But Kroger is fighting back. It unveiled a "Restock Kroger" plan in October that focuses on even lower prices, more private label brands and an increase in its digital shopping initiatives. The program seems to be working.
Overall sales were up 4.5% in the quarter, and same-store sales, a key measure of how well stores open at least a year are doing, rose more than 1%.
What's more, digital sales more than doubled thanks to the company's ClickList service, which lets consumers shop online for home delivery or be ready for pickup at the store.
"Restock Kroger is off to a great start. Customers are recognizing our efforts to redefine the customer experience and rewarding us with their loyalty," said Kroger CEO Rodney McMullen in a statement.
McMullen added that the company just saw its best-ever Black Friday general merchandise sales too, thanks to record results at the company's Fred Meyer department store subsidiary.
Kroger's comeback shows that there are some retailers that are able to hold their own with Amazon and Walmart. Home Depot and Best Buy have both thrived this year as well.
But many retailers are still hurting. Shares of Sears did soar Thursday after it said its losses narrowed, but sales continued to plunge at both Sears and Kmart stores. And Barnes & Noble tanked after the book seller reported another lousy quarter.
Copyright 2017 by CNN NewSource. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.