Walmart's online sales grew at a faster pace in the fourth quarter than Amazon's.
Yes, you read that correctly.
Walmart reported its latest results Tuesday: Earnings topped forecasts, while overall sales missed estimates slightly.
The surprising news was that Walmart's e-commerce revenue in the United States rose 29% from a year ago. That compares with a 22% increase in total sales at Amazon.
Walmart didn't say how much money it generated from its digital business. And Walmart (WMT) is still smaller than Amazon (AMZN) online. But the pride of Bentonville, Arkansas, is catching up fast.
In prepared remarks, CEO Doug McMillon said that Walmart was the second-largest online retailer in America by sales and that the Walmart mobile app is among the three most popular retail apps.
Last year, Walmart bought the e-commerce startup Jet, which also owns online furniture seller Hayneedle, for $3 billion. Walmart has also expanded its online grocery business. It offers curbside pickup and home delivery in some places.
Related: Here's why Amazon might buy a big retailer
The company also acquired ShoeBuy, a competitor to Amazon-owned Zappos, last month. It will be run by the Jet team. And just last week, Walmart bought Moosejaw, an online retailer of outdoor apparel and sporting equipment.
And Walmart now has a stake in JD.com (JD), a Chinese e-commerce company that competes with both China's market leader Alibaba (BABA)and Amazon.
That investment should help Walmart increase online sales for both the core Walmart brand and its Sam's Club warehouse in China.
So Walmart is clearly taking the threat from Amazon seriously. Investors seem pleased, too. They were sporting a big yellow Walmart smiley face Tuesday. The stock rose 3%.
Walmart wasn't the only retailer that reported good news on Tuesday. Home Depot (HD) posted sales and profits that topped forecasts. Its stock gained slightly on the news. Shares are up 7% this year.
Related: Macy's could get bought by owner of Saks and Lord & Taylor
But Walmart and Home Depot may be the exception, not the rule. Macy's (M) reported another quarter of weak sales, and its stock fell slightly.
CNNMoney recently reported that the struggling department store giant could be vulnerable to a takeover as well. Hudson's Bay (HBAYF), the owner of Lord & Taylor and Saks, has approached Macy's about a deal.
Sears (SHLD), Kohl's (KSS) and JCPenney (JCP) are other retailers that have fallen on hard times lately.
Even though Walmart is holding up better than many other traditional retailers, it is still lagging Amazon.
The Jeff Bezos-run company is up nearly 15% this year and trading at an all-time high. Amazon is worth nearly $410 billion -- almost double Walmart's market value of $220 billion.
And Amazon is taking steps to bolster its presence in the physical retail world, with more stores opening on college campuses and big cities. The Walmart-Amazon rivalry is only beginning.