After Wal-Mart Stores WMT shares took a dive this week following a sales and profit warning, and its stock market value fell even further below Amazon.com’s AMZN , many saw further proof of the demise of brick-and-mortar retailing at the hands of e-commerce.

But at a meeting with Wall Street analysts on Wednesday, Wal-Mart CEO Doug McMillon gave a full-throttled defense of the retailer’s fleet of thousands of stores in fending off Amazon, as well as other rivals.

“First, win with stores, ” McMillon told the analysts. “We know customers love shopping in stores, and they’ll want great stores.”

What gave investors agita was a forecast for no sales growth this year, and worse yet, the prospect of profit per share falling as much as 12% next year, a prognosis that fell well below Wall Street expectations.

The culprit of Wal-Mart’s poor profit forecast? The company is planning to spend billions more on its e-commerce — $2 billion in the next two fiscal years — to better integrate it with stores, including 3,400 or so big box stores and a few hundred Neighborhood Market grocery stores in the U.S. The company also gave workers additional raises to attract talent and motivate staff to better serve customers and keep stores cleaner.

For the last few years, Walmart has been trying to catch up to Amazon, whose $262.5 billion market cap now exceeds Wal-Mart’s $190 billion. (Amazon surpassed Wal-Mart on that front in July.) While Walmart has annual digital sales of about about $13 billion, and is the third-largest Internet retailer, that is still only about one-sixth of Amazon’s total, meaning Walmart still has a long way to go to catch up. And Walmart’s digital sales growth has slowed.

walmart-target

 

But McMillon said his wide fleet of stores, and the interaction with staff and product they provide, give him an advantage over pure-play e-commerce players and feeds the company’s digital business.

Without naming names, he took a jab at Amazon: “Here’s a key question. Will it be easier for an e-commerce company to build out a massive store network and create a customer service culture at scale? Or are we better able to add digital and supply chain capabilities and leverage our existing stores? We like our chances.”

One major initiative for Walmart, the largest U.S. grocer with $160 billion in sales, is expanding its drive-up service that lets customers retrieve grocery orders placed online. The company touts its fleet of stores as being ready-made infrastructure to help it roll out that service to a total of 20 markets so far, with more coming. Meanwhile, Amazon has been busy rolling out Prime Fresh with delivery straight to customers’ homes in four markets.
6922-walmartpickup-459
(As grocery pick up area at a Walmart store in Arkansas.)

McMillon said that shoppers move between both ways of shopping and that facilitating both channels leads to more spending overall. His proof: the average in-store only Walmart shopper spend $1400 a year, while the online only customers shells out $200. But the consumer who shops both ways spends $2500.

Too many stores still get a failing grade

Of course, to be useful in the fight with Amazon, stores have to be in tip top shape.

At the meeting, Greg Foran, the CEO of the $288 billion a year Walmart U.S. division, said that only 300 or 400 of its stores are “fantastic,” while only two-thirds of the stores getting a passing grade from him for cleanliness, and speed and friendliness of service. That means there are still hundreds and hundreds of stores that don’t pass muster with the boss.

In August, Walmart U.S. gave all of its store managers tablets, and all department managers have handheld mobile devices so they are not stuck in the back room and can work on the sales floor, spending more time helping customers. And real-time information is helping the retailer address a problem that has bedeviled it for years: out-of-stock items.

To get more out of its workers, Walmart has also improved pay for hundreds of thousands of in-store workers. That is costing the company $1.2 billion this year, and another $1.5 billion next year, adding pressure to its bottom line. But McMillon sees that as a necessary investment. Walmart’s stores can only be a potential weapon against Amazon if stores are well run, well stocked and inviting.

“The only way to get sustainable comps [sales growth] is by really running great stores. We need a great experience with our customers, we need strong merchandising,” McMillon said.