Wal-Mart's U.S. business accelerated during its fiscal fourth quarter, helping the world's largest retailer top Wall Street's earnings expectations and record its largest domestic same-store sales increase since July 2012.

Still, even as the company reported its 10th straight quarter of comparable sales growth, revenue fell short of expectations as foreign exchange rates and food deflation weighed on its top line.

Wal-Mart's shares shook off that miss and moved 2 percent higher in premarket trading.

Here's how Wal-Mart did:

EPS: $1.30, adjusted, versus $1.29 per share, adjusted, expected by a Thomson Reuters consensus estimate

Revenue: $130.94 billion versus $131.22 billion expected by Thomson Reuters

Comparable sales: 1.8 percent increase versus 1.3 percent increase expected by FactSet

"We've been waiting a long time for Wal-Mart to show these kinds of numbers. We like what we're seeing here. They're doing all the right things," Jan Kniffen, CEO of J.Kniffen Worldwide Enterprises, told CNBC.

Wal-Mart has been investing heavily in both its stores and e-commerce operations, which have weighed on its profitability. Last year, Wal-Mart earned $1.49 per share.

But those investments have paid off for its U.S. business, which recorded its ninth straight increase in quarterly traffic. The retailer's total sales also edged 1 percent higher from $129.67 billion a year ago.

Apparel, health and wellness, and grocery were some of the top-performing categories at the company's U.S. stores, despite a slow start to the quarter for cold-weather merchandise. Electronics, media and gaming were soft.

Wal-Mart's online sales also accelerated, boosted by its acquisition of Jet.com and the continued rollout of its online grocery service. U.S. digital sales rose 29 percent during the quarter. The company will no longer report an overarching global figure for its e-commerce growth in order to focus on the U.S. market. Its domestic online performance has been outpacing its results overseas.

"We continue to invest in e-commerce to accelerate growth," CEO Doug McMillon said in prepared remarks. "We're gaining traction and moving faster."

In a bid to better compete against Amazon, Wal-Mart has snapped up three online retailers over the past five months for a combined $3.12 billion. The largest of those acquisitions was its $3 billion purchase of Jet.com, which brought Jet Chief Marc Lore on board and led to a reshuffling of Wal-Mart's digital business.

Last month, Wal-Mart scrapped a subscription program it was testing, which offered free two-day shipping for $49 a year. Now, it will offer free shipping on more than 2 million items for no fee when shoppers spend at least $35. That's down from its previous $50 threshold.

Wal-Mart CFO Brett Biggs said the company's digital sales have improved since it implemented this change.

"They're competing with a really, really tough business in Amazon. So we kept waiting to see, could it really happen. It looks to me like it's happening," Kniffen said. "And of course, they've got strong cash flow. They can buy back stock. I mean, they're this really big, healthy company."

The company's gross margin decreased slightly, as part of its efforts to ensure it has the lowest prices. Markdowns after the holidays also weighed on Wal-Mart's gross margin.

Comparable sales at 10 of Wal-Mart's 11 international markets increased, though exchange rates pressured its top line.