A Walmart store
Walmart customers exit from a store in Miami, Florida. Walmart announced positive operating results for January 2019. Joe Raedle/Getty Images

Walmart Inc., the world’s largest private sector employer, saw its e-commerce sales in the 2018 holiday quarter ending Jan. 31 skyrocket 43 percent, allowing it to report earnings and revenue beyond analysts' expectations.

What’s more astounding is this rosy outcome included December, when U.S. retail sales recorded their biggest drop in more than nine years. This sharp fall confirms a sharp slowdown in economic activity at the end of 2018.

In its earnings report released Tuesday, Walmart said the e-commerce surge was caused by more shoppers using its online grocery delivery service and spending more per trip. A strong economy also boosted consumer spending and fueled more e-commerce purchases. The upbeat news sent Walmart shares up more than 4 percent, trading at around $104 Tuesday morning.

Revenue rose nearly 3 percent to $138.8 billion compared to the estimate of $138.7 billion and $136.3 billion year-on-year. Net income stood at $3.69 billion ($1.27 per share) compared with $2.18 billion (73 cents a share) year-on-year. Excluding one-time items.

Walmart earned $1.41 per share, or $0.08 ahead of analysts' expectations of $1.33.

“We still feel pretty good about the consumer,” said Walmart Chief Financial Officer Brett Biggs. “We haven’t seen much of a change. The data we are seeing still looks pretty healthy. Gas prices are down year over year, which helps.”

Biggs also said the consumer looks like they're in pretty good shape. He said Walmart is always monitoring the consumer and is “ready to act if things change, but we feel our guidance is good for the next year and our business model works well in most environments."

Sales at U.S. stores open at least a year improved by 4.2 percent (excluding fuel) in Q4. The increase exceeded analysts’ expectations of 2.96 percent, said Refinitiv. The early distribution of federal food stamps due to the partial government shutdown also helped boost sales, said Walmart.

Adjusted earnings per share rose to $1.41 per share, beating expectations of $1.33 per share

A Walmart store
Walmart customers exit from a store in Miami, Florida. Walmart announced positive operating results for January 2019. Joe Raedle/Getty Images

The online sales jump of 43 percent was in line with the rise in Q3. This boost was helped along by the expansion of Walmart’s online grocery pickup and delivery services and a wider product assortment on its website.

Walmart said it will add grocery deliveries to 800 more stores by the end of 2019, bringing the total to 1,600 stores. Grocery sales account for 56 percent of total revenue.

Walmart said it’s maintaining its sales outlook for 2019. It increased its annual dividend payable to shareholders on April 1 by 2 percent to $2.12 per share, up from $2.08 a share.