Americans are shopping...at Walmart

What's driving Walmart's sales?
What's driving Walmart's sales?

Retail slump? What retail slump? Walmart reported profits and sales for its latest quarter Thursday morning that topped forecasts. The retail giant also lifted its outlook for the year.

Although Walmart's sales were only up slightly overall, the company said that sales in the U.S. rose 3%. Same-store sales, which measures sales at stores open at least a year, rose 1.6% in the U.S. And earnings per share rose 12%.

Walmart's (WMT) solid results are in stark contrast to rival Target (TGT) -- which reported disappointing sales and issued a tepid forecast on Wednesday. Many other retailers -- such as Kohl's (KSS), Macy's (M) and Gap (GPS) -- have been struggling as well lately.

Walmart stock was up more than 3% in early trading Thursday. The stock is up about 20% this year, making it one of the best performers in the Dow this year.

It's been a stunningly quick turnaround for Walmart, which only last year warned of slowing sales growth and also said that higher wages for its workers and investments in its e-commerce operations would put a lid on earnings growth for a few years.

One trader joked that Walmart lowering its outlook last year might have been the best thing for the company. It's now made expectations pretty easy to beat.

Kidding aside, it is astonishing that Walmart is doing as well as it is.

The company said its profits were able to rise despite a more than 8% increase in operating costs from a year ago -- mainly due to the wage increases and increased spending on e-commerce.

But even though Walmart is now paying its workers more, the company said that the benefits of these higher expenses might outweigh the costs.

Related: Walmart deal makes overnight millionaire even richer

A Walmart executive told CNNMoney that customer service scores have improved since the raises went into effect. Workers are more enthusiastic -- and the pool of applicants for new jobs is strong, in part because of the higher wages.

As for the big investments in digital retail, it's critical for Walmart to do so as it continues to play catchup with online commerce king Amazon (AMZN). Walmart recently announced plans to buy the hot e-commerce startup Jet.com for $3.3 billion.

Earlier this year, Walmart also sold its Chinese online marketplace Yihaodian to JD.com (JD) -- the top online retail rival to Alibaba (BABA) in China.

As part of that deal, Walmart will get a 5% stake in JD.com and also open up an online store for its Sam's Club warehouse brand on JD.com.

"We remain focused on building e-commerce capabilities globally," said Walmart CEO Doug McMillon in the company's earning release. "Walmart is uniquely positioned to provide customers with a seamless shopping experience where we save them time and money."

Related: Target misses the mark and warns of weak sales ahead

Walmart still has a ways to go before it becomes a true online retail powerhouse though. Digital sales were up 11.8% in the most recent quarter -- respectable, but below the growth rate for Amazon -- and even Target, which is starting to lose momentum online.

And Walmart's international operations are a mixed bag as well. International sales were down 6.6% in the quarter -- despite strong growth in Canada, Mexico and Brazil.

Walmart announced earlier this year that it was planning to close 269 stores worldwide -- and 115 of those are outside the U.S.

Britain, in particular, is a big headache for Walmart.

Same-store sales in the U.K. plunged 7.5% in the quarter, weighing down overall international results. Walmart didn't mention this summer's Brexit vote as a reason for the softness though. It blamed lower food prices and "fierce competition."

--CNNMoney's Mike Tarson and Christine Romans contributed to this report.

CNNMoney Sponsors